Item Stack (Data Type)

An Object which defines a new item stack.

An Object which defines a new item stack.

ALIASES (1.21.1): Apace renamed itemid and amountcount to match vanilla. Both spellings are accepted. (The same aliases apply to Positioned Item Stack.)

Fields

FieldTypeDefaultDescription
itemIdentifierID of a registered item. Alias: id.
amountInteger1Size of the stack. Alias: count.
tagNBToptional(1.20.1 only) NBT data of the item — enchantments, Damage, custom name, etc.
componentsObjectoptional(1.21.1 only) Vanilla DataComponentPatch JSON, the modern equivalent of tag.

Version split (1.20.1 ↔ 1.21.1)

Vanilla MC 1.21.1 moved item-side data from NBT to DataComponents, so Apoli’s data type follows suit: 1.20.1 packs use the tag field with NBT; 1.21.1 packs use the components field with the vanilla component-patch JSON. The shape change is fundamental (e.g. {Damage: 5} becomes {"minecraft:damage": 5}), so there’s no clean way to unify them — the basic case ({"item": "..."} with no extra data) works identically on both versions.

Examples

"stack": {
    "item": "minecraft:coal",
    "amount": 24
}

An item stack of 24 coal.

"stack": {
    "item": "minecraft:golden_helmet",
    "tag": "{Enchantments: [{id: \"minecraft:projectile_protection\", lvl: 2s}]}"
}

An item stack of a golden helmet with Projectile Protection II.