ItemStack
ItemStack represents an item with its properties, durability, and metadata.
| property | type | description |
|---|---|---|
| type | String | item class name |
| name | String | registry name |
| displayName | String | display name |
| stackSize | int | current stack size |
| maxStackSize | int | max stack size |
| durability | int | remaining durability |
| maxDurability | int | max durability |
| isBlock | boolean | true if the item is a block |
| meta | int | item metadata |
constructor
Creates a new item stack from a registry name.
java
ItemStack stack = new ItemStack(String name);getEnchantments
Returns a list of enchantments on the item.
java
List<Object[]> enchantments = stack.getEnchantments();getTooltip
Returns the item's tooltip as a list of strings.
java
List<String> tooltip = stack.getTooltip();