Skip to content
Flint
Documentation

item

typePaper

A stack of items.

Properties 10

item.type: text
read-onlyPaper

Item type, such as diamond_sword.

Number of items in the stack.

item.name: text
settablePaper

Custom name (none if not renamed).

item.lore: list
settablePaper

Lore lines.

item.glow: bool
settablePaper

Enchantment shine without an enchantment. Handy for selected menu buttons.

Whether the item never loses durability.

Enchantments on the item as a map of name to level.

How worn a tool is (0 is new).

How many fit in one stack.

item.model: number
settablePaper

Custom model number for resource packs (none if unset).

Methods 6

Custom data saved on the item with set_tag, or none. Use it to recognise your own items.

Saves custom data on the item (text, number, list, map). none removes it. Returns the item.

Hides enchantments, attributes and other extra tooltip lines. Returns the item.

True if both are the same kind of item with the same name, lore and tags (amount is ignored).

Adds an enchantment, e.g. item.enchant("sharpness", 3). Returns the item.

A separate copy of the stack.