Difference between revisions of "Inventory"
(Add images for each other slot.) |
(Explain the rest of the inventories.) |
||
Line 112: | Line 112: | ||
|} | |} | ||
− | + | {{-}} | |
[[File:DoubleChest-slots.png|thumb|Double/large chest slots]] | [[File:DoubleChest-slots.png|thumb|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). | This is the window that is opened when the player right-clicks on a double chest block (two adjacent chest blocks). | ||
Line 165: | Line 167: | ||
[[File:Furnace-slots.png|thumb|Furnace slots]] | [[File:Furnace-slots.png|thumb|Furnace slots]] | ||
+ | |||
+ | The window that appears when a furnace is right-clicked. | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 193: | Line 197: | ||
[[File:Dispenser-slots.png|thumb|Dispenser/dropper slots]] | [[File:Dispenser-slots.png|thumb|Dispenser/dropper slots]] | ||
+ | |||
+ | The inventory that appears when a dispenser or dropper is opened. | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 214: | Line 220: | ||
[[File:EnchantmentTable-slots.png|thumb|Enchantment table slots]] | [[File:EnchantmentTable-slots.png|thumb|Enchantment table slots]] | ||
+ | |||
+ | The inventory of an enchantment table. The enchant buttons trigger a [[Protocol#Enchant item|Enchant item]] packet. | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 237: | Line 245: | ||
== Brewing stand == | == Brewing stand == | ||
− | [[File:BrewingStand-slots.png|thumb| | + | [[File:BrewingStand-slots.png|thumb|Brewing stand slots]] |
+ | |||
+ | The GUI that appears when a brewing stand is opened. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Slot range | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0-2 | ||
+ | | bottles/potions | ||
+ | |- | ||
+ | | 3 | ||
+ | | potion ingredient | ||
+ | |- | ||
+ | | 4-30 | ||
+ | | main inventory | ||
+ | |- | ||
+ | | 31-39 | ||
+ | | hotbar | ||
+ | |} | ||
{{-}} | {{-}} | ||
Line 244: | Line 272: | ||
[[File:Testificate-slots.png|thumb|Villeger slots]] | [[File:Testificate-slots.png|thumb|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. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Slot range | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0-1 | ||
+ | | input items | ||
+ | |- | ||
+ | | 2 | ||
+ | | result | ||
+ | |- | ||
+ | | 3–29 | ||
+ | | main inventory | ||
+ | |- | ||
+ | | 30–38 | ||
+ | | hotbar | ||
+ | |} | ||
{{-}} | {{-}} | ||
Line 250: | Line 298: | ||
[[File:Beacon-slots.png|thumb|Beacon slots]] | [[File:Beacon-slots.png|thumb|Beacon slots]] | ||
+ | |||
+ | The window that appears when a beacon is right-clicked. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Slot range | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0 | ||
+ | | payment item | ||
+ | |- | ||
+ | | 1–27 | ||
+ | | main inventory | ||
+ | |- | ||
+ | | 28–36 | ||
+ | | hotbar | ||
+ | |} | ||
{{-}} | {{-}} | ||
Line 256: | Line 321: | ||
[[File:Anvil-slots.png|thumb|Anvil slots]] | [[File:Anvil-slots.png|thumb|Anvil slots]] | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Slot range | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0 | ||
+ | | first item | ||
+ | |- | ||
+ | | 1 | ||
+ | | second item | ||
+ | |- | ||
+ | | 2 | ||
+ | | result | ||
+ | |- | ||
+ | | 3–29 | ||
+ | | main inventory | ||
+ | |- | ||
+ | | 30–38 | ||
+ | | hotbar | ||
+ | |} | ||
{{-}} | {{-}} | ||
Line 261: | Line 347: | ||
== Hopper == | == Hopper == | ||
− | [[File: | + | [[File:Hopper-slots.png|thumb|Hopper slots]] |
+ | |||
+ | The window that appears when a hopper or hopper minecart is opened. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Slot range | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0-4 | ||
+ | | hopper slots | ||
+ | |- | ||
+ | | 5–31 | ||
+ | | main inventory | ||
+ | |- | ||
+ | | 32–40 | ||
+ | | hotbar | ||
+ | |} | ||
{{-}} | {{-}} | ||
Line 268: | Line 371: | ||
[[File:Horse-slots.png|thumb|Horse slots]] | [[File:Horse-slots.png|thumb|Horse slots]] | ||
+ | |||
+ | The window for when a tamed horse is right-clicked or the player's inventory is opened while riding a horse. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Slot range | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0 | ||
+ | | saddle | ||
+ | |- | ||
+ | | 1 | ||
+ | | armor | ||
+ | |- | ||
+ | | 2–28 | ||
+ | | main inventory | ||
+ | |- | ||
+ | | 29–37 | ||
+ | | hotbar | ||
+ | |} | ||
{{-}} | {{-}} | ||
Line 274: | Line 397: | ||
[[File:Donkey-slots.png|thumb|Donkey slots]] | [[File:Donkey-slots.png|thumb|Donkey slots]] | ||
+ | |||
+ | The inventory that appears when a tamed donkey (or mule?) is right-clicked and has a chest, or when the player's inventory is opened while riding a tamed donkey or mule. | ||
+ | |||
+ | {{warning|There still is an armor slot, even though it cannot be used and is invisible.}} | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Slot range | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0 | ||
+ | | saddle | ||
+ | |- | ||
+ | | 1 | ||
+ | | armor | ||
+ | |- | ||
+ | | 2–16 | ||
+ | | donkey inventory | ||
+ | |- | ||
+ | | 17–43 | ||
+ | | player inventory | ||
+ | |- | ||
+ | | 44–52 | ||
+ | | hotbar | ||
+ | |} | ||
{{-}} | {{-}} | ||
[[Category:Minecraft Modern]] | [[Category:Minecraft Modern]] |
Revision as of 21:31, 31 December 2015
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 Inventory packet indicates which window is being opened according to:
Window Type | Description |
---|---|
minecraft:chest | Chest, large chest, or minecart with chest |
minecraft:crafting_table | Crafting table |
minecraft:furnace | Furnace |
minecraft:dispenser | Dispenser |
minecraft:enchanting_table | Enchantment table |
minecraft:brewing_stand | Brewing stand |
minecraft:villager | Villager |
minecraft:beacon | Beacon |
minecraft:anvil | Anvil |
minecraft:hopper | Hopper or minecart with hopper |
minecraft:dropper | Dropper |
EntityHorse | Horse, donkey, or mule |
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 9 unique slots (10 in the 1.9 snapshots).
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
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 |
Note that this is different from inventory items stored in a player.dat file. This may help: https://gist.github.com/459a1691c3dd751db160
Chest
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 |
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 |
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.
Crafting table
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 |
Furnace
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 |
Dispenser
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 |
Enchantment Table
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
The GUI that appears when a brewing stand is opened.
Slot range | Description |
---|---|
0-2 | bottles/potions |
3 | potion ingredient |
4-30 | main inventory |
31-39 | hotbar |
Villager trading
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
The window that appears when a beacon is right-clicked.
Slot range | Description |
---|---|
0 | payment item |
1–27 | main inventory |
28–36 | hotbar |
Anvil
Slot range | Description |
---|---|
0 | first item |
1 | second item |
2 | result |
3–29 | main inventory |
30–38 | hotbar |
Hopper
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 |
Horse
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 |
Donkey
The inventory that appears when a tamed donkey (or mule?) is right-clicked and has a chest, 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 | player inventory |
44–52 | hotbar |