Creating Cosmetics
Cosmetics are config, not commands - you add them by editing the file for their type. You need
optimalcosmetics.admin to reload and hand them out.
1. Open the type file
Section titled “1. Open the type file”Each type is one file in plugins/OptimalCosmetics/cosmetics/:
chat-colors.yml tags.yml name-paints.yml glow.ymltab-icons.yml join-messages.yml leave-messages.yml2. Add a cosmetic
Section titled “2. Add a cosmetic”Add a top-level section. The section key is the cosmetic id you’ll use in commands and case
pools. Set a Rarity, an icon Material (or Base64 for a head), a Name, and the Value that
does the work.
Ocean: Enabled: true Order: 3 Rarity: "Rare" Material: "PLAYER_HEAD" Base64: "eyJ0ZXh0dXJlcyI6..." Name: "{primary}<b>Chat Color:</b> <gradient:#00c6ff,#0072ff>Ocean</gradient>" Value: "<gradient:#00c6ff,#0072ff>{context}</gradient>"The Value differs per type - this is the one field to get right:
| Type | Value |
|---|---|
| Chat Color / Name Paint | A template with {context} (the message, or the player name). |
| Tag | The tag text. |
| Glow | Comma-separated color names, e.g. RED,GOLD,YELLOW. |
| Tab Icon | A symbol, e.g. ⛏. |
| Join / Leave Message | The message with {player}; wrap in [center]...[/center] to center it. |
Full field list and per-type detail: cosmetics reference.
3. Reload
Section titled “3. Reload”/cosmeticsadmin reloadThe cosmetic appears in /cosmetics immediately. With
Show-Locked: true players see it even before they
own it.
4. Hand it out
Section titled “4. Hand it out”Cosmetics are owned, not permission-based. Give a player one of these ways:
/cosmeticsadmin give <player> Ocean # grant it directly (works offline)/cosmeticsadmin give <player> all # grant every cosmetic/cosmeticsadmin givevoucher <player> Ocean # give a redeemable voucher (needs a Voucher block)Players can also get it by buying it on the market or winning it from a case.
Vouchers
Section titled “Vouchers”A voucher is an item a player right-clicks to unlock a cosmetic. To make a cosmetic voucher-giveable,
add a Voucher block to it (or set a global fallback in
config.yml):
Ocean: # … the fields above … Voucher: Material: PAPER Name: "&f{cosmetic} Voucher" Lore: - "{secondary} - &7Type: &f{type}" - "{secondary} - &7Rarity: &f{rarity}" - "" - "&e➥ Click to redeem!" Item-Flags: - HIDE_ATTRIBUTESTokens: {cosmetic}, {rarity}, {type}, {count}, {date}, {primary}, {secondary}. Redeeming
is blocked if the player already owns the cosmetic or has it listed on the market. Cosmetics with no
Voucher block (and no global fallback) can’t be given as vouchers.
- Disable without deleting: set
Enabled: falseto hide a cosmetic from the menu, market and counts. - Ordering:
Ordercontrols the “Item” sort (ascending).Raritycontrols the “Rarity” sort and the{primary}/{secondary}colors. - Rarities are yours: add or rename rarities in Rarity-Colors; the first one listed ranks highest.
- Nothing renders chat by itself: chat colors, tags, name paints and tab icons need a
chat/nametag/tab plugin reading the placeholders
(chat color can instead use
Paint-Chat-Message).