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
imported>BDJP007301
No edit summary
 
SyncBot (talk | contribs)
Remove broken links to missing pages
Line 14: Line 14:
|General inventories
|General inventories
|Different containers have different ranges for the slot number:
|Different containers have different ranges for the slot number:
* [[Minecraft:Item]]s, [[Minecraft:item frame]]s, [[Minecraft:Display|item displays]], [[Minecraft:arrow]]s, [[Minecraft:trident]]s, [[Minecraft:spectral arrow]]s, [[Minecraft:fireball]]s, and [[Minecraft:small fireball]]s: 0.
* [[Minecraft:Item]]s, item frames, item displays, [[Minecraft:arrow]]s, [[Minecraft:trident]]s, spectral arrows, fireballs, and small fireballs: 0.
* [[Minecraft:Barrel]]s, [[Minecraft:chest]]s, [[Minecraft:dispenser]]s, [[Minecraft:dropper]]s, [[Minecraft:hopper]]s, [[Minecraft:shulker box]]es and [[Minecraft:trapped chest]]s 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.
* [[Minecraft:Barrel]]s, [[Minecraft:chest]]s, [[Minecraft:dispenser]]s, [[Minecraft:dropper]]s, [[Minecraft:hopper]]s, 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 [[Minecraft: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 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.
* A [[Minecraft:furnace]]'s slots are numbered 0 for the input slot, 1 for the fuel slot, and 2 for the output slot.
* [[Minecraft:Player]]s: 0-35
* Players: 0-35
* [[Minecraft:Minecart with chest|Minecarts with chests]]: 0-26
* Minecarts with chests: 0-26
* [[Minecraft:Minecart with Hopper|Minecarts with hoppers]]: 0-4
* [[Minecraft:Minecart with Hopper|Minecarts with hoppers]]: 0-4
|-
|-
|98-103
|98-103
|[[Minecraft:Mobs]], [[Minecraft:player]]s, and [[Minecraft:armor stand]]s (all living entities support these slots although not all mobs show or make use of the items),
|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
*Head armor slot: 103
Line 33: Line 33:
|-
|-
|105
|105
|[[Minecraft:Mobs]], [[Minecraft:player]]s, and [[Minecraft:armor stand]]s (all living entities support these slots although not all mobs show or make use of the items)
|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:wolf armor]] on [[Minecraft:wolf]], [[Minecraft:horse armor]] on [[Minecraft:horse]]
|Slot for wolf armor on [[Minecraft:wolf]], horse armor on [[Minecraft:horse]]
|-
|-
|106
|106
|[[Minecraft:Mobs]], [[Minecraft:player]]s, and [[Minecraft:armor stand]]s (all living entities support these slots although not all mobs show or make use of the items)
|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 [[Minecraft:llama]], [[Minecraft:harness]] on [[Minecraft:happy ghast]]
|Slot for [[Minecraft:saddle]] on [[Minecraft:horse]] and [[Minecraft:pig]], [[Minecraft:carpet]] on llama, [[Minecraft:harness]] on happy ghast
|-
|-
|200-226
|200-226
|[[Minecraft:Player]]s
|Players
|Slots in ender chest
|Slots in ender chest
|-
|-
|300-307
|300-307
|[[Minecraft:Villager]]s, [[Minecraft:wandering trader]]s, [[Minecraft:pillager]]s
|[[Minecraft:Villager]]s, wandering traders, pillagers
|Their inventory
|Their inventory
|-
|-
|400
|400
|[[Minecraft:Horse]]s, [[Minecraft:donkey]]s, [[Minecraft:mule]]s, [[Minecraft:llama]]s
|[[Minecraft:Horse]]s, donkeys, mules, llamas
|Slot for saddle item
|Slot for saddle item
|-
|-
|499
|499
|Chested [[Minecraft:donkey]]s, [[Minecraft:llama]]s, [[Minecraft:mule]]s
|Chested donkeys, llamas, mules
|Slot for the chest item of [[Minecraft:Donkey]]s, [[Minecraft:llama]]s, [[Minecraft:mule]]s.
|Slot for the chest item of Donkeys, llamas, mules.
|-
|-
|499
|499
|[[Minecraft:Player]]s
|Players
|Slot for the item held by a player in GUI screens. Not available in creative mode.<ref>[https://www.minecraft.net/en-us/article/minecraft-snapshot-24w10a#:~:text=Note%3A%20this%20information%20is%20not%20available%20in%20creative%20mode 24w10a] — Note: this information is not available in creative mode</ref>
|Slot for the item held by a player in GUI screens. Not available in creative mode.<ref>[https://www.minecraft.net/en-us/article/minecraft-snapshot-24w10a#:~:text=Note%3A%20this%20information%20is%20not%20available%20in%20creative%20mode 24w10a] — Note: this information is not available in creative mode</ref>
|-
|-
|500-503
|500-503
|[[Minecraft:Player]]s
|Players
|Crafting slots in inventory screen
|Crafting slots in inventory screen
|-
|-
|500-514
|500-514
|Chested [[Minecraft:donkey]]s, [[Minecraft:llama]]s, [[Minecraft:mule]]s
|Chested donkeys, llamas, mules
|Slots in their chests.
|Slots in their chests.
|}
|}
Line 168: Line 168:


'''For a block''', its slot type is <code>slot.container</code>.
'''For a block''', its slot type is <code>slot.container</code>.
:* [[Minecraft:Barrel]]s, [[Minecraft:chest]]s, [[Minecraft:dispenser]]s, [[Minecraft:dropper]]s, [[Minecraft:hopper]]s, [[Minecraft:shulker box]]es and [[Minecraft:trapped chest]]s 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.
:* [[Minecraft:Barrel]]s, [[Minecraft:chest]]s, [[Minecraft:dispenser]]s, [[Minecraft:dropper]]s, [[Minecraft:hopper]]s, 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 [[Minecraft: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 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.
:* A [[Minecraft:furnace]]'s slots are numbered 0 for the input slot, 1 for the fuel slot, and 2 for the output slot.


Line 179: Line 179:
|-
|-
|<code>slot.weapon.mainhand</code>
|<code>slot.weapon.mainhand</code>
|any number (0 in <code>hasitem</code> [[Minecraft:target selector|selector]])
|any number (0 in <code>hasitem</code> selector)
|rowspan=6|[[Minecraft:Mob]]s only (including [[Minecraft:armor stand]]s and [[Minecraft:player]]s) (although not all mobs show or make use of the items)
|rowspan=6|[[Minecraft:Mob]]s only (including armor stands and players) (although not all mobs show or make use of the items)


[[Minecraft:Wolf]] uses <code>slot.armor.chest</code> slot for [[Minecraft:wolf armor]].
[[Minecraft:Wolf]] uses <code>slot.armor.chest</code> slot for wolf armor.
|-
|-
|<code>slot.weapon.offhand</code>
|<code>slot.weapon.offhand</code>
Line 201: Line 201:
|<code>slot.hotbar</code>
|<code>slot.hotbar</code>
|align="center"|0–8
|align="center"|0–8
|[[Minecraft:Player]]s only
|Players only
|-
|-
|<code>slot.inventory</code>
|<code>slot.inventory</code>
Line 209: Line 209:
|<code>slot.enderchest</code>
|<code>slot.enderchest</code>
|align="center"|0–26
|align="center"|0–26
|[[Minecraft:Player]]s only
|Players only
|-
|-
|<code>slot.saddle</code>
|<code>slot.saddle</code>
|any number (0 in <code>hasitem</code> selector)
|any number (0 in <code>hasitem</code> selector)
|[[Minecraft:Horse]]s, [[Minecraft:donkey]]s, [[Minecraft:mule]]s, only; item in it must be a [[Minecraft:saddle]]
|[[Minecraft:Horse]]s, donkeys, mules, only; item in it must be a [[Minecraft:saddle]]
|-
|-
|<code>slot.armor</code>
|<code>slot.armor</code>
|any number (0 in <code>hasitem</code> selector)
|any number (0 in <code>hasitem</code> selector)
|[[Minecraft:Horse]]s only; item in it must be a [[Minecraft:horse armor]]
|[[Minecraft:Horse]]s only; item in it must be a horse armor
|-
|-
|<code>slot.chest</code>
|<code>slot.chest</code>
Line 517: Line 517:
|{{HistoryLine|java}}
|{{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.}}
|{{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> [[Minecraft:argument type]] for wildcarded slot name.
|{{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.}}
|{{HistoryLine|||dev=24w11a|Added <code>contents</code> slot name for single-slot containers like items and item frames.}}
Line 530: Line 530:
*{{cmd|replaceitem}}
*{{cmd|replaceitem}}
*{{cmd|loot}}
*{{cmd|loot}}
*[[Minecraft:Target selector]]
*Target selector
*[[Minecraft:Argument types]]
*[[Minecraft:Argument types]]


Line 541: Line 541:
[[Category:Commands]]
[[Category:Commands]]


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

Revision as of 16:04, 9 April 2026

Template:Update

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

Template:Cmd 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 Template:Cd.
  • armor.*: contains Template:Cd.
  • 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 Template:Cmd and Template:Cmd. 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 Template:Cmd and Template:Cmd

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
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc
Template:EntityLink Template:Cd Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc Template:Tc

History

Template:Info needed section Template:HistoryTable

See also

References

<references/>

Navigation

Template:Navbox commands

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