Items and icons¶
Any icon can be a vanilla material, a head, or an item from another plugin.
material: DIAMOND_SWORD
material: "DIAMOND_SWORD:5" # with custom model data 5
material: "head:%player_name%" # the viewer's own head
material: "hdb:1234" # HeadDatabase
material: "itemsadder:mypack:ruby"
The field is a placeholder field like any other, so an icon can change with the player looking at it.
References¶
| Form | |
|---|---|
MATERIAL |
Any vanilla material |
MATERIAL:n |
With custom model data n |
head:<name> |
A player head by name |
head:%player_name% |
The viewer's head |
head:self |
The same thing, shorter |
texture:<base64> |
A head from a texture value |
hdb:<id> |
HeadDatabase by id |
itemsadder:<ns>:<id> |
ItemsAdder |
oraxen:<id> |
Oraxen |
nexo:<id> |
Nexo |
mmoitems:<TYPE>:<ID> |
MMOItems |
ecoitems:<id> |
EcoItems |
main_hand / off_hand |
Whatever the viewer is holding |
Every hook is optional and looked up at runtime. A reference to a plugin you do not run draws a placeholder and logs one warning, rather than taking the menu down or filling the console.
Materials that got renamed¶
Mojang renames things. GRASS became SHORT_GRASS, SIGN became OAK_SIGN,
GRASS_PATH became DIRT_PATH.
Both spellings resolve, on every version. A menu written in 2021 opens correctly today, and one written today opens on 1.16.
Slots¶
The range form exists because painting a border by hand otherwise means typing twenty-odd numbers, which is where mistakes come from.
Slots are numbered left to right, top to bottom, starting at 0.
Making it look right¶
| Field | |
|---|---|
display_name |
Colour codes and placeholders |
lore |
The grey lines underneath |
amount |
The number in the corner |
glow |
The enchanted shimmer, no real enchantment |
model_data |
Custom model data from your pack |
unbreakable |
|
hide_attributes |
Hides the damage and speed lines |
rgb |
"#ff8f00" or "255,143,0", for leather armour and potions |
enchantments |
["SHARPNESS;3"] |
item_flags |
[HIDE_ENCHANTS, HIDE_ATTRIBUTES] |
glow uses the proper toggle on 1.20.5 and newer, and falls back to a hidden
enchantment below that. Either way you do not have to think about it.
Enchantment and flag names are resolved across versions too, so DURABILITY and
UNBREAKING both work, as do HIDE_POTION_EFFECTS and
HIDE_ADDITIONAL_TOOLTIP.
Colours¶
Three spellings, all accepted anywhere text is:
Hex needs 1.16 or newer, which is our floor anyway.
Titles are capped below 1.21
The client refuses an inventory title longer than 32 characters on older versions and kicks the player out of the menu. We trim it instead, so a long title is a shortened title rather than a menu that will not open. Colour codes count toward that limit, and hex codes cost fourteen characters each.