Generalized Positioned Item Stack
An object that defines an item stack alongside a position in an inventory; generalized to all entities that may have a stack reference.
Note
Refer to Minecraft Fandom: Slot (Command argument) for the string values you can use in the slot
field of this data type.
Fields
Field | Type | Default | Description |
---|---|---|---|
item |
Identifier | The namespace and ID of the item. | |
amount |
Integer | 1 |
The size of the item. |
tag |
String | optional | The NBT data of the item. |
slot |
String | optional | The position for the item in the inventory of an entity. |
Examples
This example will define a new Diamond item stack with a size of 16.
"stacks": [
{
"item": "minecraft:shield",
"slot": "weapon.offhand"
},
{
"item": "minecraft:iron_sword",
"slot": "weapon.mainhand"
}
]
This example will define two new item stacks: a Shield that will be placed in the offhand equipment slot of the entity and an Iron Sword that will be placed in the mainhand equipment slot of the entity.