Minecraft Wiki
Advertisement

A slot is a location in the data of a block entity or entity that an item stack can be placed in.

Java Edition[]

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 (all mobs support these slots though not all mobs will show or make use of the items), players, and armor stands
  • Head armor slot: 103
  • Chest armor slot: 102
  • Leg armor slot: 101
  • Feet armor slot: 100
  • Mainhand: 98
  • Offhand: 99
200-226 Players Slots in ender chest
300-307 Villagers, wandering traders, pillagers Their inventory
400 Horses, donkeys, mules, llamas Slot for saddle item
401 Horses, llamas Slot for horse armor on horse or carpet on llama
499 Donkeys, llamas, mules with chest Slot for chest item
500-514 Donkeys, llamas, mules with chest Their inventory

Command argument[]

In commands, a slot should be referred by a string id instead of its index. The string id is mapped to its index when executing command.

A string id of slot consists of slot type and optional slot number, in the format of <slot_type> or <slot_type>.<slot_number>.

Slot string id Valid slot number Mapped index
armor.chest 102
armor.feet 100
armor.head 103
armor.legs 101
weapon
weapon.mainhand
weapon.offhand -106
container.<slot_number> 0-53 0-53
enderchest.<slot_number> 0-26 200-226
hotbar.<slot_number> 0-8 0-8
inventory.<slot_number> 0-26 9-35
horse.saddle
400
horse.chest 499
horse.armor 401
horse.<slot_number> 0-14 500-514
villager.<slot_number> 0-7 300-307

Bedrock Edition[]

Command argument[]

In commands, a slot is referred by two arguments: slot type and slot number.

For a block, its slot type is slot.container.
  • Chests, dispensers, droppers, hoppers, and trapped chests are numbered 0 for the top-left slot and then increase first horizontally, then vertically (so, for example, a chest's top row slots are numbered 0 to 8 from left to right). Double chests and double trapped chests are treated as two single container blocks.
  • A brewing stand's bottom slots are numbered 0 to 2 from left to right, its top slot is 3 and the fuel slot is 4.
  • A furnace's slots are numbered 0 for the input slot, 1 for the fuel slot, and 2 for the output slot.
For entities:
Slot Type Slot Numbers Restrictions
slot.weapon.mainhand any number (0 in hasitem selector) mobs (including armor stands), and players only (though not all mobs will show or make use of the items)
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 number of slots in inventory entities with minecraft:inventory component only
slot.enderchest 0–26 players only
slot.saddle any number (0 in hasitem selector) horses, donkeys, and mules only; item in it can only be a saddle
slot.armor any number (0 in hasitem selector) horses only; item in it can only be a horse armor
slot.chest 0–the number of slots in chest donkeys and mules with chests only
slot.equippable 0–the number of equippable slots entities with minecraft:equippable component only. Note that these slot is also defined in minecraft:inventory component.

Unsupported in /replaceitem and /loot


Slots of vanilla entities[]

Name Entity ID slot
.inventory
slot
.weapon
.mainhand
slot
.weapon
.offhand
slot
.equippable
slot
.armor
slot
.saddle
slot
.chest
slot
.enderchest
slot
.hotbar
Allay allay 1 1 1, unused No No No No No No
Boat with Chest boat_chest 27 No No No No No No No No
Donkey donkey 16 (When tamed) 1, unused 1, unused 1 (the slot of slot.saddle) No Slot 0 in slot.inventory (When tamed) Slot 1-15 in slot.inventory (When tamed) No No
Drowned drowned No 1 1 No No No No No No
Fox fox No 1 1, unused No No No No No No
Horse horse 2 (When tamed) 1, unused 1, unused 2 (slot 0 is slot.saddle, 1 is slot.armor) Slot 1 in slot.inventory (When tamed) Slot 0 in slot.inventory(When tamed) No No No
Husk husk No 1 1 No No No No No No
Llama llama 16 (When tamed) 1, unused 1, unused 1 (the slot of slot.saddle) No No No No No
Minecart with Chest chest_minecart 27 No No No No No No No No
Minecart with Hopper hopper_minecart 5 No No No No No No No No
Mule mule 16 (When tamed) 1, unused 1, unused 1 (the slot of slot.saddle) No Slot 0 in slot.inventory (When tamed) Slot 1-15 in slot.inventory (When tamed) No No
Panda panda 1 1 1, unused No No No No No No
Piglin piglin 8 1 1 No No No No No No
Piglin Brute piglin_brute No 1 1 No No No No No No
Player player 27 1 from slot.hotbar 1 No No No No 27 9
Skeleton skeleton No 1 1 No No No No No No
Stray stray No 1 1 No No No No No No
Villager villager 8 1 1, unused No No No No No No
Zombie zombie No 1 1 No No No No No No
Zombie Villager zombie_villager No 1 1 No No No No No No

History[]

This section of the article is empty. 
You can help by adding to it.

See also[]

Advertisement