![]() |
VOOZH | about |
A slot is a location in the data of a block entity or entity that an item stack can be placed in.
A slot is defined by its slot index.
| Slot index | Used by | Description |
|---|---|---|
| 0-53 | General inventories | Different containers have different ranges for the slot number:
|
| 98-103 | Mobs, players, and armor stands (all living entities support these slots although not all mobs show or make use of the items), |
|
| 105 | Mobs, players, and armor stands (all living entities support these slots although not all mobs show or make use of the items) | Slot for wolf armor on wolf, horse armor on horse |
| 106 | Mobs, players, and armor stands (all living entities support these slots although not all mobs show or make use of the items) | Slot for saddle on horse and pig, carpet on llama, harness on happy ghast |
| 200-226 | Players | Slots in ender chest |
| 300-307 | Villagers, wandering traders, pillagers | Their inventory |
| 400 | Horses, donkeys, mules, llamas | Slot for saddle item |
| 499 | Chested donkeys, llamas, mules | Slot for the chest item of Donkeys, llamas, mules. |
| 499 | Players | Slot for the item held by a player in GUI screens. Not available in creative mode.[1] |
| 500-503 | Players | Crafting slots in inventory screen |
| 500-514 | Chested donkeys, llamas, mules | Slots in their chests. |
In commands, a slot should be referred by a string name instead of its index. The string name is mapped to its index when executing command.
A string name of slot consists of slot type and optional slot number, in the format of <slot_type> or <slot_type>.<slot_number>.
| Slot string name | Valid slot number | Mapped index |
|---|---|---|
contents
|
0 | |
container.<slot_number>
|
0-53 | 0-53 |
hotbar.<slot_number>
|
0-8 | 0-8 |
inventory.<slot_number>
|
0-26 | 9-35 |
enderchest.<slot_number>
|
0-26 | 200-226 |
horse.<slot_number>
|
0-14 | 500-514 |
weapon
|
98 | |
weapon.mainhand
|
98 | |
weapon.offhand
|
99 | |
armor.head
|
103 | |
armor.chest
|
102 | |
armor.legs
|
101 | |
armor.feet
|
100 | |
armor.body
|
105 | |
horse.saddle |
400 | |
horse.chest
|
499 | |
player.cursor
|
499 | |
player.crafting.<slot_number>
|
0-3 | 500-503 |
/execute if items and /item fill[upcoming: JE 26.3] commands also supports wildcarded slot names:
container.*: contains container.0 to container.53.hotbar.*: contains hotbar.0 to hotbar.8.inventory.*: contains inventory.0 to inventory.26.enderchest.*: contains enderchest.0 to enderchest.26.horse.*: contains horse.0 to horse.14.weapon.*: contains weapon.mainhand, and weapon.offhand.armor.*: contains armor.head, armor.chest, armor.legs, armor.feet, and armor.body.player.crafting.*: contains player.crafting.0 to player.crafting.3.In commands, a slot is referred by two arguments: slot type and slot number.
For a block, its slot type is slot.container.
For entities:
| Slot Type | Slot Numbers | Restrictions |
|---|---|---|
slot.weapon.mainhand
|
any number (0 in hasitem selector)
|
Mobs only (including armor stands and players) (although not all mobs show or make use of the items)
Wolf uses |
slot.weapon.offhand
|
any number (0 in hasitem selector)
| |
slot.armor.head
|
any number (0 in hasitem selector)
| |
slot.armor.chest
|
any number (0 in hasitem selector)
| |
slot.armor.legs
|
any number (0 in hasitem selector)
| |
slot.armor.feet
|
any number (0 in hasitem selector)
| |
slot.hotbar
|
0–8 | Players only |
slot.inventory
|
0–the size of the inventory minus 1 | Entities with minecraft:inventory component only
|
slot.enderchest
|
0–26 | Players only |
slot.saddle
|
any number (0 in hasitem selector)
|
Horses, donkeys, mules, only; item in it must be a saddle |
slot.armor
|
any number (0 in hasitem selector)
|
Horses only; item in it must be a horse armor |
slot.chest
|
0–the size of the chest minus 1 | Chested donkeys, mules and llamas only
There's a bug in |
slot.equippable
|
0–the number of equippable slots minus 1 | Entities with minecraft:equippable component only. Note that these slots refer to slots in minecraft:inventory component.
Unsupported in |
| Name | Entity ID | slot .inventory |
slot .weapon .mainhand |
slot .weapon .offhand |
slot .equippable |
slot .armor |
slot .saddle |
slot .chest |
slot .enderchest |
slot .hotbar |
|---|---|---|---|---|---|---|---|---|---|---|
| 👁 Image Allay |
allay
|
1 | 1 | 1, unused | No | No | No | No | No | No |
| 👁 Image Boat with Chest |
boat_chest
|
27 | No | No | No | No | No | No | No | No |
| 👁 Image Camel |
camel
|
1 | 1, unused | 1, unused | 1 (refers to the slot of slot.saddle) | No | Refers to slot 0 in slot.inventory | No | No | No |
| 👁 Image Donkey |
donkey
|
16 (When tamed) | 1, unused | 1, unused | 1 (refers to the slot of slot.saddle) | No | Refers to slot 0 in slot.inventory (When tamed) | 15 (refers to slot 1–15 in slot.inventory[2]) (When tamed and chested) | No | No |
| 👁 Image Drowned |
drowned
|
No | 1 | 1 | No | No | No | No | No | No |
| 👁 Image Fox |
fox
|
No | 1 | 1, unused | No | No | No | No | No | No |
| 👁 Image Horse |
horse
|
2 (When tamed) | 1, unused | 1, unused | 2 (slot 0 refers to slot.saddle, 1 refers to slot.armor) | Refers to slot 1 in slot.inventory (When tamed) | Refers to slot 0 in slot.inventory (When tamed) | No | No | No |
| 👁 Image Husk |
husk
|
No | 1 | 1 | No | No | No | No | No | No |
| 👁 Image Llama |
llama
|
16 (When tamed) | 1, unused | 1, unused | 1 (refers to slot 0 in slot.inventory) | No | No | N (refers to slot 1–N in slot.inventory; N is the size of the chest[3])(When tamed and chested) | No | No |
| 👁 Image Minecart with Chest |
chest_minecart
|
27 | No | No | No | No | No | No | No | No |
| 👁 Image Minecart with Hopper |
hopper_minecart
|
5 | No | No | No | No | No | No | No | No |
| 👁 Image Mule |
mule
|
16 (When tamed) | 1, unused | 1, unused | 1 (refers to the slot of slot.saddle) | No | Refers to slot 0 in slot.inventory (When tamed) | 15 (refers to slot 1–15 in slot.inventory[2]) (When tamed and chested) | No | No |
| 👁 Image Panda |
panda
|
1 | 1 | 1, unused | No | No | No | No | No | No |
| 👁 Image Piglin |
piglin
|
8 | 1 | 1 | No | No | No | No | No | No |
| 👁 Image Piglin Brute |
piglin_brute
|
No | 1 | 1 | No | No | No | No | No | No |
| 👁 Image Player |
player
|
27 | 1 from slot.hotbar | 1 | No | No | No | No | 27 | 9 |
| 👁 Image Skeleton |
skeleton
|
No | 1 | 1 | No | No | No | No | No | No |
| 👁 Image Stray |
stray
|
No | 1 | 1 | No | No | No | No | No | No |
| 👁 Image Villager |
villager
|
8 | 1 | 1, unused | No | No | No | No | No | No |
| 👁 Image Zombie |
zombie
|
No | 1 | 1 | No | No | No | No | No | No |
| 👁 Image Zombie Villager |
zombie_villager
|
No | 1 | 1 | No | No | No | No | No | No |
| 👁 Image Happy Ghast |
happy_ghast
|
No | 1, unused | 1, unused | No | 1, used for harness | No | No | No | No |
| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.20.5 | 24w05a | Replaced horse.armor (401) slot argument with armor.body (105), applicable now to all mobs. | |||||
| 24w10a | Added item_slots argument type for wildcarded slot name.
| ||||||
Added player.cursor and player.crafting.<slot_number> slot name. | |||||||
| 24w11a | Added contents slot name for single-slot containers like items and item frames. | ||||||
| pre1 | Fixed contents slot not working for shot arrows, tridents, spectral arrows, fireballs, and small fireballs.[4] | ||||||
| Bedrock Edition | |||||||
| 1.21.20 | Preview 1.21.10.20 | Added slot.armor.body slot name. | |||||
/replaceitem and /loot. The slot numbers of slot.chest for the two commands are -1–13, referring to slot 0–14 in slot.inventory
/replaceitem and /loot. The slot numbers of slot.chest for the two commands are -1–(N-2), referring to slot 0–(N-1) in slot.inventory