Slot

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.


 * {| class="wikitable sortable" data-description="Slot Index"

!Slot index !Used by !Description
 * 0-53
 * General inventories
 * Different containers have different ranges for the slot number:
 * 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.
 * players: 0-35
 * minecarts with chests: 0-26
 * minecarts with hoppers: 0-4
 * item frames: 0
 * 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
 * }
 * 499
 * Donkeys, llamas, mules with chest
 * Slot for chest item
 * 500-514
 * Donkeys, llamas, mules with chest
 * Their inventory
 * }
 * Their inventory
 * }

Command argument
In commands, a slot should be refered 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  or.


 * {| class="wikitable sortable" data-description="Slot mapping"

!Slot string id !Valid slot number !Mapped index
 * align="center"|102
 * align="center"|100
 * align="center"|103
 * align="center"|101
 * align="center"|98
 * align="center"|98
 * align="center"|99
 * align="center"|0-53
 * align="center"|0-53
 * align="center"|0-26
 * align="center"|200-226
 * align="center"|0-8
 * align="center"|0-8
 * align="center"|0-26
 * align="center"|9-35
 * align="center"|400
 * align="center"|499
 * align="center"|401
 * align="center"|0-14
 * align="center"|500-514
 * align="center"|0-7
 * align="center"|300-307
 * }
 * align="center"|98
 * align="center"|99
 * align="center"|0-53
 * align="center"|0-53
 * align="center"|0-26
 * align="center"|200-226
 * align="center"|0-8
 * align="center"|0-8
 * align="center"|0-26
 * align="center"|9-35
 * align="center"|400
 * align="center"|499
 * align="center"|401
 * align="center"|0-14
 * align="center"|500-514
 * align="center"|0-7
 * align="center"|300-307
 * }
 * align="center"|0-26
 * align="center"|9-35
 * align="center"|400
 * align="center"|499
 * align="center"|401
 * align="center"|0-14
 * align="center"|500-514
 * align="center"|0-7
 * align="center"|300-307
 * }
 * align="center"|499
 * align="center"|401
 * align="center"|0-14
 * align="center"|500-514
 * align="center"|0-7
 * align="center"|300-307
 * }
 * align="center"|0-14
 * align="center"|500-514
 * align="center"|0-7
 * align="center"|300-307
 * }
 * align="center"|300-307
 * }

Command argument
In commands, a slot is refered by two arguments: slot type and slot number.


 * For a block, its slot type is.
 * 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:


 * {| class="wikitable" data-description="Slot information"

!Slot Type !Slot Numbers !Restrictions
 * any number (0 in  selector)
 * rowspan=6|mobs (including armor stands), and players only (though not all mobs will show or make use of the items)
 * any number (0 in  selector)
 * any number (0 in  selector)
 * any number (0 in  selector)
 * any number (0 in  selector)
 * any number (0 in  selector)
 * align="center"|0–8
 * players only
 * align="center"|0–the number of slots in inventory
 * entities with  component only
 * align="center"|0–26
 * players only
 * any number (0 in  selector)
 * horses, donkeys, and mules only; item in it can only be a saddle
 * any number (0 in  selector)
 * horses only; item in it can only be a horse armor
 * align="center"|0–the number of slots in chest
 * donkeys, llamas, and mules with chests only
 * align="center"|0–the number of equippable slots
 * entities with  component only. Note that these slot is also defined in   component.
 * align="center"|0–8
 * players only
 * align="center"|0–the number of slots in inventory
 * entities with  component only
 * align="center"|0–26
 * players only
 * any number (0 in  selector)
 * horses, donkeys, and mules only; item in it can only be a saddle
 * any number (0 in  selector)
 * horses only; item in it can only be a horse armor
 * align="center"|0–the number of slots in chest
 * donkeys, llamas, and mules with chests only
 * align="center"|0–the number of equippable slots
 * entities with  component only. Note that these slot is also defined in   component.
 * any number (0 in  selector)
 * horses only; item in it can only be a horse armor
 * align="center"|0–the number of slots in chest
 * donkeys, llamas, and mules with chests only
 * align="center"|0–the number of equippable slots
 * entities with  component only. Note that these slot is also defined in   component.
 * align="center"|0–the number of slots in chest
 * donkeys, llamas, and mules with chests only
 * align="center"|0–the number of equippable slots
 * entities with  component only. Note that these slot is also defined in   component.
 * align="center"|0–the number of equippable slots
 * entities with  component only. Note that these slot is also defined in   component.

Unsupported in and
 * }