Live handle to one item stack. From e:held_item(), e:equipped(slot),
inventory.item, game.item(id), and similar. An inventory
slot handle tracks whatever is in that slot now.
Methods
Method
Meaning
id, name, count
Item id ("minecraft:diamond_sword"), display name, stack size
Bracketed chat name ([Diamond Sword] with show-item hover)
lore
Lore lines as text components, or nil
tooltip(advanced?)
Tooltip lines exactly as the inventory renders them
food
{nutrition, saturation, can_always_eat} for food, or nil
tags
Item tag ids, e.g. "minecraft:swords"
attribute_modifiers
{attribute, id, value, operation, slot}[], or nil
Data components
Method
What it does
item:has_component(id)
true if the stack has the component
item:component(id)
Decoded Lua value; true if present but not decodable; nil if absent
local held = player:held_item()if held:enchantments()["minecraft:sharpness"] then print(held:name() .. " has Sharpness")endif held:has_component("minecraft:piercing_weapon") then local weapon = held:component("minecraft:piercing_weapon") print(held:name() .. " dismounts: " .. tostring(weapon.dismounts))end