Inventory Slot Numbers Minecraft

broken image


Minecraft displays the player inventory differently, according to how the window was opened. Ranges of slot indices vary in meaning between different 'windows'. The Open Window packet indicates which window is being opened according to:

  • 2Chest
  • 4Furnace
Window TypeDescription
minecraft:generic_9x1A 1-row inventory, not used by the notchian server.
minecraft:generic_9x2A 2-row inventory, not used by the notchian server.
minecraft:generic_9x3General-purpose 3-row inventory. Used by Chest, minecart with chest, ender chest, and barrel
minecraft:generic_9x4A 4-row inventory, not used by the notchian server.
minecraft:generic_9x5A 5-row inventory, not used by the notchian server.
minecraft:generic_9x6General-purpose 6-row inventory, used by large chests.
minecraft:generic_3x3General-purpose 3-by-3 square inventory, used by Dispenser and Dropper
minecraft:anvilAnvil
minecraft:beaconBeacon
minecraft:blast_furnaceBlast Furnace
minecraft:brewing_standBrewing stand
minecraft:craftingCrafting table
minecraft:enchantmentEnchantment table
minecraft:furnaceFurnace
minecraft:grindstoneGrindstone
minecraft:hopperHopper or minecart with hopper
minecraft:lecternLectern
minecraft:loomLoom
minecraft:merchantVillager, Wandering Trader
minecraft:shulker_boxShulker box
minecraft:smokerSmoker
minecraft:cartographyCartography Table
minecraft:stonecutterStonecutter

SuckFromSlot(side:number, slot:number, count:number):boolean Takes up to count items from the specified slot of the inventory at the specified side and puts them into the currently selected slot. Side - a valid side. Slot - the slot to take the item from. Count - how many items to transfer. Returns: true if at least one item was moved, false otherwise. Given below is a detailed list of all Commands in Minecraft. 1 List of Commands 1.1 ability 1.2 alwaysday 1.3 clear 1.4 clone 1.5 connect 1.6 deop 1.7 difficulty 1.8 effect 1.9 enchant 1.10 execute 1.11 fill 1.12 function 1.13 gamemode 1.14 gamerule 1.15 give 1.16 help 1.17 immutableworld 1.18 kill 1.19 list 1.20 locate 1.21 me 1.22 mixer 1.23 mobevent 1.24 op 1.25 particle 1.26 playsound 1.27. Anyone know the ID of the Helmet slot in the normal Inventory? Search an interactive list of Minecraft blocks, items, mobs, entities, potions, ids and data values.

The following information needs to be added to this page:
Most of the inventories new to 1.14 have buttons, which are probably implemented using Protocol#Click Window Button. This needs to be confirmed and the button IDs should be checked.

The slot number is calculated starting at 0, counting up through the window's unique slots, and then counting through the players inventory.

For all windows, the slot in the upper-left corner of the player's inventory is slot n where n is the number of unique slots, and slot number -999 is always used for clicking outside the window.

The default inventory window, which is never explicitly opened by the server, has 10 unique slots.

Rectangular regions are always indexed starting with the upper-left corner and scanning across rows. If a window has a crafting region, the output slot is always slot 0 followed immediately by the input region.

Each window type is described in the following sections. All slot index ranges are inclusive and reflect the indices observed in the Minecraft protocol.

Inventory

For the window properties (additional data in each window, e.g. smelting progress or enchantments), refer to the table in the Window Property packet.

Using -1 as slot index and as window id will set the cursor item (the stack dragged with the mouse).

Player Inventory

Inventory slots
Inventory Slot Numbers Minecraft

This is the inventory window that the player can always open, typically by pressing E since Beta 1.4. Before, you had to press I.

Slot rangeDescription
0crafting output
1–42×2 crafting input (1 + x + 2 * y)
5–8armor (head, chest, legs, feet)
9–35main inventory
36–44hotbar
45Offhand slot

Note that this is different from inventory items stored in a player.dat file. This may help: https://gist.github.com/459a1691c3dd751db160

Chest

Chest slots

This is the window that is opened when the player right-clicks on a single chest block.

Slot rangeDescription
0–26chest
27–53main inventory
54–62hotbar
Double/large chest slots

Large chest

This is the window that is opened when the player right-clicks on a double chest block (two adjacent chest blocks).

Slot rangeDescription
0–53chest
54–80main inventory
81–89hotbar

It is possible to receive different 'Number Of Slots' parameters than those two. In vanilla, using /setblock four times around a chest and then opening the middle chest will open a window with 5*27 chest slots. Some custom servers will send chest inventories with other sizes, usually ranging from 1 row to 6 rows. These may be used for custom GUIs. It is thus important to correctly use the 'Number Of Slots' parameter in the open window packet to determine the number of rows in the chest, rather than hardcoding what constitutes a regular chest or a large chest.

Crafting table

Crafting table slots

This is the window that is opened when the player right-clicks on a workbench.

Slot rangeDescription
0crafting output
1–93×3 crafting input (1 + x + 3 * y)
10–36main inventory
37–45hotbar

If the 'Number Of Slots' parameter is not set to 0, the opened window will behave like a container window.

Furnace

Furnace slots

The window that appears when a furnace is right-clicked.

Slot rangeDescription
0ingredient
1fuel
2output
3–29main inventory
30–38hotbar

If the 'Number Of Slots' parameter is inferior to 3, placing an item in a slot may crash the client.

Blast Furnace

Blast Furnace slots

The GUI that appears when a blast furnace is opened. Same layout as a furnace; however, the recipe book displays blast furnace recipes instead of regular furnace recipes.

Slot rangeDescription
0ingredient
1fuel
2output
3–29main inventory
30–38hotbar

Smoker

Minecraft
Smoker slots

The GUI that appears when a smoker is opened. Same layout as a furnace; however, the recipe book displays blast furnace recipes instead of regular furnace recipes.

Slot rangeDescription
0ingredient
1fuel
2output
3–29main inventory
30–38hotbar

Dispenser

Dispenser/dropper slots

The inventory that appears when a dispenser or dropper is opened.

Slot rangeDescription
0–83×3 dispenser contents (x + 3 * y)
9–35main inventory
36-44hotbar

If the 'Number Of Slots' parameter is inferior to 9, placing an item in a slot may crash the client.

Enchantment Table

Enchantment table slots

The inventory of an enchantment table. The enchant buttons trigger a Enchant item packet.

Slot rangeDescription
0item to enchant
1lapis lazuli slot
2–28main inventory
29–37hotbar

Brewing stand

Brewing stand slots

The GUI that appears when a brewing stand is opened.

Slot rangeDescription
0-2bottles/potions
3potion ingredient
4blaze powder
5-31main inventory
32-40hotbar

Villager trading

Merchant slots

The GUI that appears when a villager is right-clicked. Note that if the villager only requires one item, you can put it in either (or both) slots.

Slot rangeDescription
0-1input items
2result
3–29main inventory
30–38hotbar
Minecraft player inventory slot numbers

For the window properties (additional data in each window, e.g. smelting progress or enchantments), refer to the table in the Window Property packet.

Using -1 as slot index and as window id will set the cursor item (the stack dragged with the mouse).

Player Inventory

Inventory slots

This is the inventory window that the player can always open, typically by pressing E since Beta 1.4. Before, you had to press I.

Slot rangeDescription
0crafting output
1–42×2 crafting input (1 + x + 2 * y)
5–8armor (head, chest, legs, feet)
9–35main inventory
36–44hotbar
45Offhand slot

Note that this is different from inventory items stored in a player.dat file. This may help: https://gist.github.com/459a1691c3dd751db160

Chest

Chest slots

This is the window that is opened when the player right-clicks on a single chest block.

Slot rangeDescription
0–26chest
27–53main inventory
54–62hotbar
Double/large chest slots

Large chest

This is the window that is opened when the player right-clicks on a double chest block (two adjacent chest blocks).

Slot rangeDescription
0–53chest
54–80main inventory
81–89hotbar

It is possible to receive different 'Number Of Slots' parameters than those two. In vanilla, using /setblock four times around a chest and then opening the middle chest will open a window with 5*27 chest slots. Some custom servers will send chest inventories with other sizes, usually ranging from 1 row to 6 rows. These may be used for custom GUIs. It is thus important to correctly use the 'Number Of Slots' parameter in the open window packet to determine the number of rows in the chest, rather than hardcoding what constitutes a regular chest or a large chest.

Crafting table

Crafting table slots

This is the window that is opened when the player right-clicks on a workbench.

Slot rangeDescription
0crafting output
1–93×3 crafting input (1 + x + 3 * y)
10–36main inventory
37–45hotbar

If the 'Number Of Slots' parameter is not set to 0, the opened window will behave like a container window.

Furnace

Furnace slots

The window that appears when a furnace is right-clicked.

Slot rangeDescription
0ingredient
1fuel
2output
3–29main inventory
30–38hotbar

If the 'Number Of Slots' parameter is inferior to 3, placing an item in a slot may crash the client.

Blast Furnace

Blast Furnace slots

The GUI that appears when a blast furnace is opened. Same layout as a furnace; however, the recipe book displays blast furnace recipes instead of regular furnace recipes.

Slot rangeDescription
0ingredient
1fuel
2output
3–29main inventory
30–38hotbar

Smoker

Smoker slots

The GUI that appears when a smoker is opened. Same layout as a furnace; however, the recipe book displays blast furnace recipes instead of regular furnace recipes.

Slot rangeDescription
0ingredient
1fuel
2output
3–29main inventory
30–38hotbar

Dispenser

Dispenser/dropper slots

The inventory that appears when a dispenser or dropper is opened.

Slot rangeDescription
0–83×3 dispenser contents (x + 3 * y)
9–35main inventory
36-44hotbar

If the 'Number Of Slots' parameter is inferior to 9, placing an item in a slot may crash the client.

Enchantment Table

Enchantment table slots

The inventory of an enchantment table. The enchant buttons trigger a Enchant item packet.

Slot rangeDescription
0item to enchant
1lapis lazuli slot
2–28main inventory
29–37hotbar

Brewing stand

Brewing stand slots

The GUI that appears when a brewing stand is opened.

Slot rangeDescription
0-2bottles/potions
3potion ingredient
4blaze powder
5-31main inventory
32-40hotbar

Villager trading

Merchant slots

The GUI that appears when a villager is right-clicked. Note that if the villager only requires one item, you can put it in either (or both) slots.

Slot rangeDescription
0-1input items
2result
3–29main inventory
30–38hotbar

Beacon

Beacon slots

The window that appears when a beacon is right-clicked.

Slot rangeDescription
0payment item
1–27main inventory
28–36hotbar

Anvil

Anvil slots
Slot rangeDescription
0first item
1second item
2result
3–29main inventory
30–38hotbar

Hopper

Hopper slots

The window that appears when a hopper or hopper minecart is opened.

Slot rangeDescription
0-4hopper slots
5–31main inventory
32–40hotbar

Shulker box

Shulker box slots

This is the window that is opened when the player right-clicks on a shulker box chest.

Slot rangeDescription
0–26box slots
27–53main inventory
54–62hotbar

Llama

Llama slots

The inventory that appears when a tamed llama is right-clicked and has a chest, or when the player's inventory is opened while riding a tamed llama. Depending on the value of the strength field, the number of chest rows may vary (max is 5, so 15 slots).

There still is a saddle slot, even though it cannot be used and is invisible.

Slot positions within the llama inventory vary - slot 2 may be at (1,0) or at (0,1) depending on the number of columns.

Slot rangeDescription
0saddle
1carpet
2-(2+3*Strength)llama inventory
(2+3*Strength)+1-(2+3*Strength)+27player inventory
(2+3*Strength)+28-(2+3*Strength)+35hotbar
  • Unchested llama

  • Llama with strength 1

  • Llama with strength 2

  • Llama with strength 3

  • Llama with strength 4

  • Llama with strength 5

Horse

Horse slots

The window for when a tamed horse is right-clicked or the player's inventory is opened while riding a horse.

Slot rangeDescription
0saddle
1armor
2–28main inventory
29–37hotbar
  • Horse slots

  • Skeleton horse slots

  • Zombie horse slots

Donkey

Donkey slots

The inventory that appears when a tamed donkey (or mule?) is right-clicked, or when the player's inventory is opened while riding a tamed donkey or mule.

There still is an armor slot, even though it cannot be used and is invisible.

Slot rangeDescription
0saddle
1armor
2–16donkey inventory
17–43 (2-28 if unchested)player inventory
44–52 (29-37 if unchested)hotbar
  • Unchested donkey

  • Chested donkey

  • Unchested mule

  • Chested mule

Cartography Table

Cartography table slots

The GUI that appears when a cartography table is opened.

Slot rangeDescription
0map
1paper
2output
3–29main inventory
30–38hotbar

Grindstone

Grindstone slots
Slot rangeDescription
0first item
1second item
2result
3–29main inventory
30–38hotbar

Lectern

Lectern UI

This is a regular container, unlike with held books opened via Protocol#Open Book.

The following information needs to be added to this page:
Is the player inventory also included on this?


Slot rangeDescription
0book
1–27main inventory?
28–36hotbar?

Loom

Loom slots
Slot rangeDescription
0banner
1dye
2pattern
3result
4–30main inventory
31–39hotbar

Stonecutter

Stonecutter slots
Slot rangeDescription
0input
1result
2–28main inventory
29–37hotbar
Retrieved from 'https://wiki.vg/index.php?title=Inventory&oldid=14899'

Minecraft displays the player inventory differently, according to how the window was opened. Ranges of slot indices vary in meaning between different 'windows'. The Open Window packet indicates which window is being opened according to:

  • 2Chest
Window Type Description
minecraft:container Fallback for unknown types; also used for Ender chests. Behaves the same as minecraft:chest.
minecraft:chestChest, large chest, or minecart with chest
minecraft:crafting_tableCrafting table
minecraft:furnaceFurnace
minecraft:dispenserDispenser
minecraft:enchanting_tableEnchantment table
minecraft:brewing_standBrewing stand
minecraft:villagerVillager
minecraft:beaconBeacon
minecraft:anvilAnvil
minecraft:hopperHopper or minecart with hopper
minecraft:dropperDropper
minecraft:shulker_boxShulker box
EntityHorseHorse, donkey, mule or Llama

The slot number is calculated starting at 0, counting up through the window's unique slots, and then counting through the players inventory.

For all windows, the slot in the upper-left corner of the player's inventory is slot n where n is the number of unique slots, and slot number -999 is always used for clicking outside the window.

The number of unique slots in the window is sent in the Open Window (Play, 0x2d, clientbound) packet for all storage windows (e.g. Chest, Dropper). For non-storage windows (the items get dropped when the window is closed, e.g. Workbench, Anvil), the received number of unique slots is always 0, but it can be looked up by the client from the window type.

The default inventory window, which is never explicitly opened by the server, has 10 unique slots.

Rectangular regions are always indexed starting with the upper-left corner and scanning across rows. If a window has a crafting region, the output slot is always slot 0 followed immediately by the input region.

Each window type is described in the following sections. All slot index ranges are inclusive and reflect the indices observed in the Minecraft protocol.

For the window properties (additional data in each window, e.g. smelting progress or enchantments), refer to the table in the Window Property packet.

Using -1 as slot index and as window id will set the cursor item (the stack dragged with the mouse).

Player Inventory

Inventory slots

This is the inventory window that the player can always open, typically by pressing E since Beta 1.4. Before, you had to press I.

Slot range Description
0 crafting output
1–4 2×2 crafting input (1 + x + 2 * y)
5–8 armor (head, chest, legs, feet)
9–35 main inventory
36–44 hotbar
45 Offhand slot

Note that this is different from inventory items stored in a player.dat file. This may help: https://gist.github.com/459a1691c3dd751db160

Chest

Chest slots

This is the window that is opened when the player right-clicks on a single chest block.

Slot range Description
0–26 chest
27–53 main inventory
54–62 hotbar
Double/large chest slots

Large chest

This is the window that is opened when the player right-clicks on a double chest block (two adjacent chest blocks).

Slot range Description
0–53 chest
54–80 main inventory
81–89 hotbar

It is possible to receive different 'Number Of Slots' parameters than those two. In vanilla, using /setblock four times around a chest and then opening the middle chest will open a window with 5*27 chest slots. Some custom servers will send chest inventories with other sizes, usually ranging from 1 row to 6 rows. These may be used for custom GUIs. It is thus important to correctly use the 'Number Of Slots' parameter in the open window packet to determine the number of rows in the chest, rather than hardcoding what constitutes a regular chest or a large chest.

Crafting table

Crafting table slots

This is the window that is opened when the player right-clicks on a workbench.

Slot range Description
0 crafting output
1–9 3×3 crafting input (1 + x + 3 * y)
10–36 main inventory
37–45 hotbar

If the 'Number Of Slots' parameter is not set to 0, the opened window will behave like a container window.

Furnace

Furnace slots

The window that appears when a furnace is right-clicked.

Slot range Description
0 ingredient
1 fuel
2 output
3–29 main inventory
30–38 hotbar

If the 'Number Of Slots' parameter is inferior to 3, placing an item in a slot may crash the client.

Dispenser

Dispenser/dropper slots

The inventory that appears when a dispenser or dropper is opened.

Slot range Description
0–8 3×3 dispenser contents (x + 3 * y)
9–35 main inventory
36-44 hotbar

If the 'Number Of Slots' parameter is inferior to 9, placing an item in a slot may crash the client.

Enchantment Table

Enchantment table slots

The inventory of an enchantment table. The enchant buttons trigger a Enchant item packet.

Slot range Description
0 item to enchant
1 lapis lazuli slot
2–28 main inventory
29–37 hotbar

Brewing stand

Brewing stand slots

The GUI that appears when a brewing stand is opened.

Slot range Description
0-2 bottles/potions
3 potion ingredient
4 blaze powder
5-31 main inventory
32-40 hotbar

Villager trading

Villeger slots

The GUI that appears when a villager is right-clicked. Note that if the villager only requires one item, you can put it in either (or both) slots.

Slot range Description
0-1 input items
2 result
3–29 main inventory
30–38 hotbar

Beacon

Beacon slots

The window that appears when a beacon is right-clicked.

Slot range Description
0 payment item
1–27 main inventory
28–36 hotbar

Anvil

Anvil slots
Slot range Description
0 first item
1 second item
2 result
3–29 main inventory
30–38 hotbar

Hopper

Hopper slots

The window that appears when a hopper or hopper minecart is opened.

Slot range Description
0-4 hopper slots
5–31 main inventory
32–40 hotbar

Shulker box

Shulker box slots

This is the window that is opened when the player right-clicks on a shulker box chest.

Slot range Description
0–26 box slots
27–53 main inventory
54–62 hotbar

Llama

Inventory Slot Numbers Minecraft Pe

Llama slots

The inventory that appears when a tamed llama is right-clicked and has a chest, or when the player's inventory is opened while riding a tamed llama. Depending on the value of the strength field, the number of chest rows may vary (max is 5, so 15 slots).

There still is a saddle slot, even though it cannot be used and is invisible.

Slot positions within the llama inventory vary - slot 2 may be at (1,0) or at (0,1) depending on the number of columns.

Slot range Description
0 saddle
1 carpet
2-(2+3*Strength) llama inventory
(2+3*Strength)+1-(2+3*Strength)+27 player inventory
(2+3*Strength)+28-(2+3*Strength)+35 hotbar
  • Unchested llama

  • Llama with strength 1

  • Llama with strength 2

  • Llama with strength 3

  • Llama with strength 4

  • Llama with strength 5

Horse

Inventory Slot Numbers Minecraft

Horse slots

The window for when a tamed horse is right-clicked or the player's inventory is opened while riding a horse.

Slot range Description
0 saddle
1 armor
2–28 main inventory
29–37 hotbar

Minecraft Player Inventory Slot Numbers

  • Horse slots

  • Skeleton horse slots

  • Zombie horse slots

Donkey

Donkey slots

The inventory that appears when a tamed donkey (or mule?) is right-clicked, or when the player's inventory is opened while riding a tamed donkey or mule.

There still is an armor slot, even though it cannot be used and is invisible.

Slot range Description
0 saddle
1 armor
2–16 donkey inventory
17–43 (2-28 if unchested) player inventory
44–52 (29-37 if unchested) hotbar

Inventory Slot Numbers Minecraft

  • Unchested donkey

  • Chested donkey

  • Unchested mule

  • Chested mule

Retrieved from 'http://wiki.vg/index.php?title=Inventory&oldid=14093'




broken image