Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Slot: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Remove broken links to missing pages
SyncBot (talk | contribs)
Fix template calls: add MC/ prefix
 
Line 1: Line 1:
{{Update|A lot has changed with slots since this page was actually majorly updated, example: the offhand slot for players is no longer the -106th slot of the inventory, it's now located in the "equipment.offhand" NBT tag, and the page also contains a lot of incorrect info in general.}}
{{MC/Update|A lot has changed with slots since this page was actually majorly updated, example: the offhand slot for players is no longer the -106th slot of the inventory, it's now located in the "equipment.offhand" NBT tag, and the page also contains a lot of incorrect info in general.}}


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 a location in the data of a block entity or entity that an item stack can be placed in.
Line 152: Line 152:
|}
|}


{{cmd|execute if items}} command also supports wildcarded slot names:
{{MC/Cmd|execute if items}} command also supports wildcarded slot names:
* <code>container.*</code>: contains <code>container.0</code> to <code>container.53</code>.
* <code>container.*</code>: contains <code>container.0</code> to <code>container.53</code>.
* <code>hotbar.*</code>: contains <code>hotbar.0</code> to <code>hotbar.8</code>.
* <code>hotbar.*</code>: contains <code>hotbar.0</code> to <code>hotbar.8</code>.
Line 158: Line 158:
* <code>enderchest.*</code>: contains <code>enderchest.0</code> to <code>enderchest.26</code>.
* <code>enderchest.*</code>: contains <code>enderchest.0</code> to <code>enderchest.26</code>.
* <code>horse.*</code>: contains <code>horse.0</code> to <code>horse.14</code>.
* <code>horse.*</code>: contains <code>horse.0</code> to <code>horse.14</code>.
* <code>weapon.*</code>: contains {{cd|d=and|weapon.mainhand|weapon.offhand}}.
* <code>weapon.*</code>: contains {{MC/Cd|d=and|weapon.mainhand|weapon.offhand}}.
* <code>armor.*</code>: contains {{cd|d=and|armor.head|armor.chest|armor.legs|armor.feet|armor.body}}.
* <code>armor.*</code>: contains {{MC/Cd|d=and|armor.head|armor.chest|armor.legs|armor.feet|armor.body}}.
* <code>player.crafting.*</code>: contains <code>player.crafting.0</code> to <code>player.crafting.3</code>.
* <code>player.crafting.*</code>: contains <code>player.crafting.0</code> to <code>player.crafting.3</code>.


Line 223: Line 223:
|Chested donkeys, mules and llamas only
|Chested donkeys, mules and llamas only


There's a bug in {{cmd|replaceitem}} and {{cmd|loot}}. The slot numbers for the two commands are -1–''the size of the chest minus 2''
There's a bug in {{MC/Cmd|replaceitem}} and {{MC/Cmd|loot}}. The slot numbers for the two commands are -1–''the size of the chest minus 2''
|-
|-
|<code>slot.equippable</code>
|<code>slot.equippable</code>
Line 229: Line 229:
|Entities with <code>minecraft:equippable</code> component only. Note that these slots refer to slots in <code>minecraft:inventory</code> component.
|Entities with <code>minecraft:equippable</code> component only. Note that these slots refer to slots in <code>minecraft:inventory</code> component.


'''Unsupported''' in {{cmd|replaceitem}} and {{cmd|loot}}
'''Unsupported''' in {{MC/Cmd|replaceitem}} and {{MC/Cmd|loot}}
|}
|}


Line 247: Line 247:
!slot<br>.hotbar
!slot<br>.hotbar
|-
|-
|{{EntityLink|Allay}}
|{{MC/Entitylink|Allay}}
|{{cd|allay}}
|{{MC/Cd|allay}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|partial|1, unused}}
|{{MC/Tc|partial|1, unused}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|id=oak boat with chest|Boat with Chest}}
|{{MC/Entitylink|id=oak boat with chest|Boat with Chest}}
|{{cd|boat_chest}}
|{{MC/Cd|boat_chest}}
|{{tc|yes|27}}
|{{MC/Tc|yes|27}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Camel}}
|{{MC/Entitylink|Camel}}
|{{cd|camel}}
|{{MC/Cd|camel}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|partial|1, unused}}
|{{MC/Tc|partial|1, unused}}
|{{tc|partial|1, unused}}
|{{MC/Tc|partial|1, unused}}
|{{tc|yes|1 (refers to the slot of slot.saddle)}}
|{{MC/Tc|yes|1 (refers to the slot of slot.saddle)}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|yes|refers to slot 0 in slot.inventory}}
|{{MC/Tc|yes|refers to slot 0 in slot.inventory}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Donkey}}
|{{MC/Entitylink|Donkey}}
|{{cd|donkey}}
|{{MC/Cd|donkey}}
|{{tc|yes|16 <small>(When tamed)</small>}}
|{{MC/Tc|yes|16 <small>(When tamed)</small>}}
|{{tc|partial|1, unused}}
|{{MC/Tc|partial|1, unused}}
|{{tc|partial|1, unused}}
|{{MC/Tc|partial|1, unused}}
|{{tc|yes|1 (refers to the slot of slot.saddle)}}
|{{MC/Tc|yes|1 (refers to the slot of slot.saddle)}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|yes|refers to slot 0 in slot.inventory <small>(When tamed)</small>}}
|{{MC/Tc|yes|refers to slot 0 in slot.inventory <small>(When tamed)</small>}}
|{{tc|yes|15 (refers to slot 1–15 in slot.inventory<ref name="slot-chest">There's a bug in {{cmd|replaceitem}} and {{cmd|loot}}. The slot numbers of <code>slot.chest</code> for the two commands are -1–13, referring to slot 0–14 in slot.inventory</ref>) <small>(When tamed and chested)</small>}}
|{{tc|yes|15 (refers to slot 1–15 in slot.inventory<ref name="slot-chest">There's a bug in {{MC/Cmd|replaceitem}} and {{MC/Cmd|loot}}. The slot numbers of <code>slot.chest</code> for the two commands are -1–13, referring to slot 0–14 in slot.inventory</ref>) <small>(When tamed and chested)</small>}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Drowned}}
|{{MC/Entitylink|Drowned}}
|{{cd|drowned}}
|{{MC/Cd|drowned}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Fox}}
|{{MC/Entitylink|Fox}}
|{{cd|fox}}
|{{MC/Cd|fox}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|partial|1, unused}}
|{{MC/Tc|partial|1, unused}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Horse}}
|{{MC/Entitylink|Horse}}
|{{cd|horse}}
|{{MC/Cd|horse}}
|{{tc|yes|2 <small>(When tamed)</small>}}
|{{MC/Tc|yes|2 <small>(When tamed)</small>}}
|{{tc|partial|1, unused}}
|{{MC/Tc|partial|1, unused}}
|{{tc|partial|1, unused}}
|{{MC/Tc|partial|1, unused}}
|{{tc|yes|2 (slot 0 refers to slot.saddle, 1 refers to slot.armor)}}
|{{MC/Tc|yes|2 (slot 0 refers to slot.saddle, 1 refers to slot.armor)}}
|{{tc|yes|refers to slot 1 in slot.inventory <small>(When tamed)</small>}}
|{{MC/Tc|yes|refers to slot 1 in slot.inventory <small>(When tamed)</small>}}
|{{tc|yes|refers to slot 0 in slot.inventory <small>(When tamed)</small>}}
|{{MC/Tc|yes|refers to slot 0 in slot.inventory <small>(When tamed)</small>}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Husk}}
|{{MC/Entitylink|Husk}}
|{{cd|husk}}
|{{MC/Cd|husk}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Llama}}
|{{MC/Entitylink|Llama}}
|{{cd|llama}}
|{{MC/Cd|llama}}
|{{tc|yes|16 <small>(When tamed)</small>}}
|{{MC/Tc|yes|16 <small>(When tamed)</small>}}
|{{tc|partial|1, unused}}
|{{MC/Tc|partial|1, unused}}
|{{tc|partial|1, unused}}
|{{MC/Tc|partial|1, unused}}
|{{tc|yes|1 (refers to slot 0 in slot.inventory)}}
|{{MC/Tc|yes|1 (refers to slot 0 in slot.inventory)}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|yes|N (refers to slot 1–N in slot.inventory; N is the size of the chest<ref>There's a bug in {{cmd|replaceitem}} and {{cmd|loot}}. The slot numbers of <code>slot.chest</code> for the two commands are -1–(N-2), referring to slot 0–(N-1) in slot.inventory</ref>)<small>(When tamed and chested)</small>}}
|{{tc|yes|N (refers to slot 1–N in slot.inventory; N is the size of the chest<ref>There's a bug in {{MC/Cmd|replaceitem}} and {{MC/Cmd|loot}}. The slot numbers of <code>slot.chest</code> for the two commands are -1–(N-2), referring to slot 0–(N-1) in slot.inventory</ref>)<small>(When tamed and chested)</small>}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Minecart with Chest}}
|{{MC/Entitylink|Minecart with Chest}}
|{{cd|chest_minecart}}
|{{MC/Cd|chest_minecart}}
|{{tc|yes|27}}
|{{MC/Tc|yes|27}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Minecart with Hopper}}
|{{MC/Entitylink|Minecart with Hopper}}
|{{cd|hopper_minecart}}
|{{MC/Cd|hopper_minecart}}
|{{tc|yes|5}}
|{{MC/Tc|yes|5}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Mule}}
|{{MC/Entitylink|Mule}}
|{{cd|mule}}
|{{MC/Cd|mule}}
|{{tc|yes|16 <small>(When tamed)</small>}}
|{{MC/Tc|yes|16 <small>(When tamed)</small>}}
|{{tc|partial|1, unused}}
|{{MC/Tc|partial|1, unused}}
|{{tc|partial|1, unused}}
|{{MC/Tc|partial|1, unused}}
|{{tc|yes|1 (refers to the slot of slot.saddle)}}
|{{MC/Tc|yes|1 (refers to the slot of slot.saddle)}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|yes|refers to slot 0 in slot.inventory <small>(When tamed)</small>}}
|{{MC/Tc|yes|refers to slot 0 in slot.inventory <small>(When tamed)</small>}}
|{{tc|yes|15 (refers to slot 1–15 in slot.inventory<ref name="slot-chest"/>) <small>(When tamed and chested)</small>}}
|{{MC/Tc|yes|15 (refers to slot 1–15 in slot.inventory<ref name="slot-chest"/>) <small>(When tamed and chested)</small>}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Panda}}
|{{MC/Entitylink|Panda}}
|{{cd|panda}}
|{{MC/Cd|panda}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|partial|1, unused}}
|{{MC/Tc|partial|1, unused}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Piglin}}
|{{MC/Entitylink|Piglin}}
|{{cd|piglin}}
|{{MC/Cd|piglin}}
|{{tc|yes|8}}
|{{MC/Tc|yes|8}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Piglin Brute}}
|{{MC/Entitylink|Piglin Brute}}
|{{cd|piglin_brute}}
|{{MC/Cd|piglin_brute}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Player}}
|{{MC/Entitylink|Player}}
|{{cd|player}}
|{{MC/Cd|player}}
|{{tc|yes|27}}
|{{MC/Tc|yes|27}}
|{{tc|yes|1 from slot.hotbar}}
|{{MC/Tc|yes|1 from slot.hotbar}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|yes|27}}
|{{MC/Tc|yes|27}}
|{{tc|yes|9}}
|{{MC/Tc|yes|9}}
|-
|-
|{{EntityLink|Skeleton}}
|{{MC/Entitylink|Skeleton}}
|{{cd|skeleton}}
|{{MC/Cd|skeleton}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Stray}}
|{{MC/Entitylink|Stray}}
|{{cd|stray}}
|{{MC/Cd|stray}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Villager}}
|{{MC/Entitylink|Villager}}
|{{cd|villager}}
|{{MC/Cd|villager}}
|{{tc|yes|8}}
|{{MC/Tc|yes|8}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|partial|1, unused}}
|{{MC/Tc|partial|1, unused}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Zombie}}
|{{MC/Entitylink|Zombie}}
|{{cd|zombie}}
|{{MC/Cd|zombie}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Zombie Villager}}
|{{MC/Entitylink|Zombie Villager}}
|{{cd|zombie_villager}}
|{{MC/Cd|zombie_villager}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|yes|1}}
|{{MC/Tc|yes|1}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|-
|-
|{{EntityLink|Happy Ghast}}
|{{MC/Entitylink|Happy Ghast}}
|{{Cd|happy_ghast}}
|{{MC/Cd|happy_ghast}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|partial|1, unused}}
|{{MC/Tc|partial|1, unused}}
|{{tc|partial|1, unused}}
|{{MC/Tc|partial|1, unused}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|yes|1, used for harness}}
|{{MC/Tc|yes|1, used for harness}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|{{tc|no}}
|{{MC/Tc|no}}
|}
|}


== History ==
== History ==
{{info needed section|Did pigs and striders ever gain a saddle slot, or happy ghasts a harness slot?}}
{{MC/Info needed section|Did pigs and striders ever gain a saddle slot, or happy ghasts a harness slot?}}
{{HistoryTable
{{HistoryTable
|{{HistoryLine|java}}
|{{MC/HistoryLine|java}}
|{{HistoryLine||1.20.5|dev=24w05a|Replaced <code>horse.armor</code> (401) slot argument with <code>armor.body</code> (105), applicable now to all mobs.}}
|{{MC/HistoryLine||1.20.5|dev=24w05a|Replaced <code>horse.armor</code> (401) slot argument with <code>armor.body</code> (105), applicable now to all mobs.}}
|{{HistoryLine|||dev=24w10a|Added <code>item_slots</code> argument type for wildcarded slot name.
|{{MC/HistoryLine|||dev=24w10a|Added <code>item_slots</code> argument type for wildcarded slot name.
|Added <code>player.cursor</code> and <code>player.crafting.<slot_number></code> slot name.}}
|Added <code>player.cursor</code> and <code>player.crafting.<slot_number></code> slot name.}}
|{{HistoryLine|||dev=24w11a|Added <code>contents</code> slot name for single-slot containers like items and item frames.}}
|{{MC/HistoryLine|||dev=24w11a|Added <code>contents</code> slot name for single-slot containers like items and item frames.}}
|{{HistoryLine|||dev=pre1|Fixed <code>contents</code> slot not working for shot arrows, tridents, spectral arrows, fireballs, and small fireballs.<ref>{{bug|MC-270119|||fixed}}</ref>}}
|{{HistoryLine|||dev=pre1|Fixed <code>contents</code> slot not working for shot arrows, tridents, spectral arrows, fireballs, and small fireballs.<ref>{{bug|MC-270119|||fixed}}</ref>}}


|{{HistoryLine|bedrock}}
|{{MC/HistoryLine|bedrock}}
|{{HistoryLine||1.21.20|dev=Preview 1.21.10.20|Added <code>slot.armor.body</code> slot name.}}
|{{MC/HistoryLine||1.21.20|dev=Preview 1.21.10.20|Added <code>slot.armor.body</code> slot name.}}
}}
}}


== See also ==
== See also ==
*{{cmd|item}}
*{{MC/Cmd|item}}
*{{cmd|replaceitem}}
*{{MC/Cmd|replaceitem}}
*{{cmd|loot}}
*{{MC/Cmd|loot}}
*Target selector
*Target selector
*[[Minecraft:Argument types]]
*[[Minecraft:Argument types]]
Line 537: Line 537:


== Navigation ==
== Navigation ==
{{Navbox commands}}
{{MC/Navbox commands}}


[[Category:Commands]]
[[Category:Commands]]

Latest revision as of 20:57, 9 April 2026

Template:Message boxTemplate:Article other

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),
  • Head armor slot: 103
  • Chest armor slot: 102
  • Leg armor slot: 101
  • Feet armor slot: 100
  • Mainhand: 98
  • Offhand: 99
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
  1. REDIRECT Template:Command

Template:Redr command 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
  1. REDIRECT Template:Code

Template:Redr.

  • armor.*: contains
  1. REDIRECT Template:Code

Template:Redr.

  • player.crafting.*: contains player.crafting.0 to player.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.mainhand any number (0 in hasitem selector) Minecraft:Mobs only (including armor stands and players) (although not all mobs show or make use of the items)

Minecraft:Wolf uses slot.armor.chest slot for wolf armor.

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) Minecraft:Horses, donkeys, mules, only; item in it must be a Minecraft:saddle
slot.armor any number (0 in hasitem selector) Minecraft: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

  1. REDIRECT Template:Command

Template:Redr and

  1. REDIRECT Template:Command

Template:Redr. The slot numbers for the two commands are -1–the size of the chest minus 2

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

  1. REDIRECT Template:Command

Template:Redr and

  1. REDIRECT Template:Command

Template:Redr

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
  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

Template:Tc
  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

Template:Tc
  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:EntityLink
  1. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

  1. REDIRECT Template:Table choice

Template:Redr

History

  1. REDIRECT Template:Incomplete section

Template:HistoryTable

See also

  1. REDIRECT Template:Command

Template:Redr

  1. REDIRECT Template:Command

Template:Redr

  1. REDIRECT Template:Command

Template:Redr

References

<references/>

Navigation

All editions
Removed
Template:El only
Debug
Removed
Template:Els only
Template:El only
Removed
Template:El only
Removed
Template:Els only
Removed
Joke
Related

de:Inventarplatz ja:スロット pt:Espaço zh:槽位