Minecraft:Slot
More actions
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, 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 Minecraft:wolf, horse armor on Minecraft: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 Minecraft:saddle on Minecraft:horse and Minecraft:pig, Minecraft:carpet on llama, Minecraft:harness on happy ghast |
| 200-226 | Players | Slots in ender chest |
| 300-307 | Minecraft:Villagers, wandering traders, pillagers | Their inventory |
| 400 | Minecraft: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.<ref>24w10a — Note: this information is not available in creative mode</ref> |
| 500-503 | Players | Crafting slots in inventory screen |
| 500-514 | Chested donkeys, llamas, mules | Slots in their chests. |
Command argument
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 |
Template:Cmd command also supports wildcarded slot names:
container.*: containscontainer.0tocontainer.53.hotbar.*: containshotbar.0tohotbar.8.inventory.*: containsinventory.0toinventory.26.enderchest.*: containsenderchest.0toenderchest.26.horse.*: containshorse.0tohorse.14.weapon.*: contains Template:Cd.armor.*: contains Template:Cd.player.crafting.*: containsplayer.crafting.0toplayer.crafting.3.
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.
- Minecraft:Barrels, Minecraft:chests, Minecraft:dispensers, Minecraft:droppers, Minecraft:hoppers, shulker boxes 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 Minecraft: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.mainhandany number (0 in hasitemselector)Minecraft:Mobs only (including armor stands and players) (although not all mobs show or make use of the items) Minecraft:Wolf uses
slot.armor.chestslot for wolf armor.slot.weapon.offhandany number (0 in hasitemselector)slot.armor.headany number (0 in hasitemselector)slot.armor.chestany number (0 in hasitemselector)slot.armor.legsany number (0 in hasitemselector)slot.armor.feetany number (0 in hasitemselector)slot.hotbar0–8 Players only slot.inventory0–the size of the inventory minus 1 Entities with minecraft:inventorycomponent onlyslot.enderchest0–26 Players only slot.saddleany number (0 in hasitemselector)Minecraft:Horses, donkeys, mules, only; item in it must be a Minecraft:saddle slot.armorany number (0 in hasitemselector)Minecraft:Horses only; item in it must be a horse armor slot.chest0–the size of the chest minus 1 Chested donkeys, mules and llamas only There's a bug in Template:Cmd and Template:Cmd. The slot numbers for the two commands are -1–the size of the chest minus 2
slot.equippable0–the number of equippable slots minus 1 Entities with minecraft:equippablecomponent only. Note that these slots refer to slots inminecraft:inventorycomponent.Unsupported in Template:Cmd and Template:Cmd
Slots of vanilla entities
History
See also
- Template:Cmd
- Template:Cmd
- Template:Cmd
- Target selector
- Minecraft:Argument types
References
<references/>
de:Inventarplatz ja:スロット pt:Espaço zh:槽位