Skip to content

ItemObject

An item is a dict-like object with version-normalized properties. nbt contains raw version-dependent data.

View the source

Removes the item from its original player’s inventory and returns the ItemObject that was taken. Available on Minecraft 1.4.2 and later. Before Minecraft 1.8, it uses /clear by item ID and count instead of an exact slot operation, so identical stacks may be affected.

AttributeTypeDescription
item.slotstrSlot identifier such as hotbar.0, armor.head or inventory.0
item.idstrItem identifier
item.countintItem quantity
item.damageintDurability/damage value
item.custom_namestr / NoneCustom display name
item.lorelistDisplay lore lines
item.enchantmentsdict / listEnchantment entries; representation depends on the NBT source and version-normalization path
item.attribute_modifierslistAttribute modifier entries
item.nbtdictRaw item NBT/components; structure varies by Minecraft version