You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
array {[player,] slot} Returns an associative array of known item meta for the slot given, or null if there isn't any. ----
1
+
array {[player,] slot} Returns an associative array of known item data in the slot given, or null if there isn't any.
2
+
3
+
----
2
4
3
5
These fields exist for all items with meta.
4
-
* '''display''' : (string) The display name seen when renamed in an anvil (or null).
5
-
* '''lore''' : (array) A list of strings that is displayed when hovering the item (or null). As lines are plain text, they do not yet support some advanced text components, but color codes are supported.
6
-
* '''model''' : (int) Represents vanilla's CustomModelData tag for use with resource packs (or null). Is converted to a float for the custom_model_data component in 1.21.4+.
7
-
* '''flags''' : (array) Flags used to hide meta in the item tooltip: %ITEM_FLAGS%.
8
-
* '''repair''' : (int) The additional cost to repair or combine this item in an anvil.
9
-
* '''enchants''' : (associative array) The enchantments on this item.
10
-
** '''<enchantment_name>''' : (associative array) Name of enchantment as the key (e.g. "fire_aspect") An integer for the level can be used as the value instead of an array.
11
-
*** '''elevel''' : (int) The level of the enchantment.
12
-
* '''modifiers''' : (array) A list of attribute modifier arrays (or null).
13
-
** (associative array)
14
-
*** '''attribute''' : (string) One of %ATTRIBUTES%.
15
-
*** '''operation''' : (string) One of %OPERATIONS%.
16
-
*** '''amount''' : (double) The value used in the modifier operation.
17
-
*** '''id''' : (string) An item can only have one modifier with the same id.
18
-
*** '''slot''' : (string) Possible slots are %SLOTS% or one of the slot groups %SLOTGROUPS%.
19
-
* '''tags''' : (associative array) Custom tags used by plugins (or null).
20
-
** '''<custom_key>''' : (associative array) Each tag's key is namespaced (e.g. "commandhelper:mytag"). If not provided, "commandhelper" will be used as a namespace.
21
-
*** '''type''' : (string) Possible types: %TAG_TYPES%.
22
-
*** '''value''' : (mixed) A valid value for the given tag type.
| The display name seen when renamed in an anvil (or null).
15
+
|-
16
+
! lore
17
+
| array
18
+
| A list of strings that is displayed when hovering the item (or null). As lines are plain text, they do not yet support some advanced text components, but color codes are supported.
19
+
|-
20
+
! model
21
+
| int
22
+
| Represents vanilla's CustomModelData tag for use with resource packs (or null). In 1.21.4+, this represents the first float in custom_model_data rounded down.
23
+
|-
24
+
! flags
25
+
| array
26
+
| Flags used to hide meta in the item tooltip: %ITEM_FLAGS%.
27
+
|-
28
+
! repair
29
+
| int
30
+
| The additional cost to repair or combine this item in an anvil.
31
+
|-
32
+
! enchants
33
+
| associative array
34
+
| The enchantments on this item.
35
+
* '''<enchantment_name>''' : (associative array) The name of the enchantment as the key (e.g. "fire_aspect") An integer for the level can be used as the value instead of an array.
36
+
** '''elevel''' : (int) The level of the enchantment.
37
+
|-
38
+
! modifiers
39
+
| array
40
+
| A list of attribute modifier arrays (or null).
41
+
* (associative array)
42
+
** '''attribute''' : (string) One of %ATTRIBUTES%.
43
+
** '''operation''' : (string) One of %OPERATIONS%.
44
+
** '''amount''' : (double) The value used in the modifier operation.
45
+
** '''id''' : (string) An item can only have one modifier with the same id.
46
+
** '''slot''' : (string) Possible slots are %SLOTS% or one of the slot groups %SLOTGROUPS%.
47
+
|-
48
+
! tags
49
+
| associative array
50
+
| Custom tags used by plugins (or null).
51
+
* '''<custom_key>''' : (associative array) Each tag's key is namespaced (e.g. "commandhelper:mytag"). If not provided, "commandhelper" will be used as a namespace.
52
+
** '''type''' : (string) Possible types: %TAG_TYPES%.
53
+
** '''value''' : (mixed) A valid value for the given tag type.
54
+
|}
23
55
24
56
These fields optionally exist for any item type.
25
-
* '''damage''' : (int) The amount of damage on the durability of the item. 0 is undamaged. The max value is determined by the item type's default durability or "maxdamage" if set.
26
-
* '''unbreakable''' : (boolean) If the item cannot be damaged when used. Also hides item durability bar. Field always exists if "damage" exists.
27
-
* '''maxstacksize''' : (int) Overrides the maximum quantity of items with identical meta that will stack. Must be from 1 to 99. (MC 1.20.6+)
28
-
* '''maxdamage''' : (int) Overrides an item's max durability. Value must be positive. (MC 1.20.6+)
* '''rarity''' : (string) Overrides an item's rarity, which affects the item name color. Can be COMMON (white), UNCOMMON (yellow), RARE (aqua), or EPIC (light purple). (MC 1.20.6+)
* '''enchantability''' : (int) Overrides an item's enchantability in an enchanting table. Value must be positive. Higher values allow applicable enchantments with higher costs to be picked. (MC 1.21.3+)
| The amount of damage on the durability of the item. 0 is undamaged. The max value is determined by the item type's default durability or "maxdamage" if set.
66
+
|-
67
+
! unbreakable
68
+
| boolean
69
+
| If the item cannot be damaged when used. Also hides item durability bar. Field always exists if "damage" exists.
70
+
|-
71
+
! maxstacksize
72
+
| int
73
+
| Overrides the maximum quantity of items with identical meta that will stack. Must be from 1 to 99. (MC 1.20.6+)
74
+
|-
75
+
! maxdamage
76
+
| int
77
+
| Overrides the item's max durability. Value must be positive. (MC 1.20.6+)
78
+
|-
79
+
! glint
80
+
| boolean
81
+
| Overrides the item's enchantment glint state. (MC 1.20.6+)
82
+
|-
83
+
! rarity
84
+
| string
85
+
| Overrides the item's rarity, which affects the item name color. Can be COMMON (white), UNCOMMON (yellow), RARE (aqua), or EPIC (light purple). (MC 1.20.6+)
86
+
|-
87
+
! food
88
+
| associative array
89
+
| Overrides the consumable item's food stats. (MC 1.20.6+)
90
+
* '''nutrition''' : (int) Food restored on the hunger bar when consumed. (default: 0)
91
+
* '''saturation''' : (double) The amount of saturation that is increased when consumed. (default: 0.0)
92
+
* '''always''' : (boolean) Whether the food can be consumed even if the hunger bar is full. (default: false)
93
+
|-
94
+
! jukeboxsong
95
+
| string
96
+
| Overrides the item's playable jukebox song. (MC 1.21+)
97
+
|-
98
+
! enchantability
99
+
| int
100
+
| Overrides the item's enchantability in an enchanting table. Value must be positive. Higher values allow applicable enchantments with higher costs to be picked. (MC 1.21.3+)
101
+
|-
102
+
! glider
103
+
| boolean
104
+
| Overrides if the item allows gliding when equipped like an elytra. (MC 1.21.3+)
105
+
|-
106
+
! remainder
107
+
| associative array
108
+
| Overrides the remaining item when the this item is used. (MC 1.21.3+)
MC 1.21.4+: "custom_model_data" for anything other than a single float
258
-
MC 1.21.5+: "weapon", "potion_duration_scale", "blocks_attacks", "break_sound", "provides_banner_patterns", "provides_trim_material", "tooltip_display"
327
+
* MC 1.13.2: "can_break" and "can_place_on" (Paper only)
328
+
* MC 1.20.5 : "item_name", "note_block_sound", "intangible_projectile" (Paper 1.21.3 only), "instrument" (partial support due to partial server API), "tool" (partial server API), "hide_tooltip" (later integrated into "tooltip_display"), "lock" (insufficient server API)
329
+
* MC 1.21.2 : "damage_resistant", "tooltip_style", "use_cooldown", "item_model", "death_protection" (Paper only), "repairable" (Paper only), "consumable" (added in Spigot 1.21.4 API), "equippable" (added in Spigot 1.21.5 API)
330
+
* MC 1.21.4: "custom_model_data" (for anything other than a single float rounded down)
331
+
* MC 1.21.5: "weapon", "blocks_attacks", "break_sound", "provides_banner_patterns", "provides_trim_material", "potion_duration_scale" (Paper only), "tooltip_display" (partially supported with "flags")
0 commit comments