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.
:::
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 and item display: 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
===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)	mobs (including armor stands), and players only (though not all mobs will show or make use of the items)
slot.armor.head 	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.armor.chest 	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.armor.legs 	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.armor.feet 	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.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 and
===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
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
 	 	 	 	 	 	 	 	 	 	
==History==
==See also==
*
*
*
*Target selector
*Argument types
Category:Commands