Skip to content
Flint
Dokumentation

item

typePaper

A stack of items.

Egenskaber 10

item.type: text
skrivebeskyttetPaper

Item type, such as diamond_sword.

item.amount: number
kan ændresPaper

Number of items in the stack.

item.name: text
kan ændresPaper

Custom name (none if not renamed).

item.lore: list
kan ændresPaper

Lore lines.

item.glow: bool
kan ændresPaper

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

item.unbreakable: bool
kan ændresPaper

Whether the item never loses durability.

item.enchantments: map
skrivebeskyttetPaper

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

item.damage: number
kan ændresPaper

How worn a tool is (0 is new).

item.max_stack: number
skrivebeskyttetPaper

How many fit in one stack.

item.model: number
kan ændresPaper

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

Metoder 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.