Inventory slot numbers
Buildings
Chest, inventory and furnace slot numbersLearn more
That's the number they write in a menu configuring and get from a click processor. Numbering from zero, left to right, and top down -- except for the player's equipment, where things are different.
My game select version
We'll remember in this browser and set up where your version is available. Open link settings are more important than this choice; the Vicki versions do not change.
Container
The chest, the barrel, the shulker, and the menu-- Twenty-seventh session
At the top are container slots, the same numbers that they write in the cannibal. Next up, starting at 27, the player's equipment: it's a OKNA number, it gives them away. getRawSlot(). Point at any of them and you will see the second number, the one that will return getSlot().
The window is one on a chest, a barrel, and a shulker box: they are not different from any slot. The plagina menu is the same as it is, only rows range from one to six, and the numbers do not move: six rows are a large trunk.
How to use
- Find the slot in the window
Point at the cell or enter the number into the search - analysis will tell you what the slot is occupied and where the number comes from.
- Enter the number in the menu config
slot: 13 in DeluxeMenus and ChestCommands - the center of the menu with 27 slots.
- In the code - remember the window
getSlot() in the click handler counts across the window: below the container, the numbers continue with the player’s inventory.
Three places where people stumble
- Counting from scratch. The second row of the chest starts with nine, not ten; the menu center for 27 slots is 13. The lot number counts as 9 × row + column, and both terms are also from zero.
- The player's inventory is not numbered in the order in which it is drawn. Quick access is 0–8, and it is drawn below; above it lie 9–35. That is, slot 0 is not in the upper left corner, as everywhere else, but in the lower left.
- The recipe block has unequal slots. In furnace 0, what's floating and 1 is fuel, though it's drawn below. In versteak 0, it's the result, and the grid itself starts with one. To confuse input with output is the most frequent error, and there will be no fall from it: the object will simply not be there.
The numbers are taken from the Bukkit API - the same one that plugins use (Inventory.getItem(int)), - and verified with the Minecraft Wiki protocol table.
Plugin menu
- The size shall be 9 and not more than 54: 9, 18, 27, 36, 45, 54. The rest of the server rejects with IllegalArgumentException right when creating the menu - including zero, although the documentation mentions it. The switch above the window shows any of the six.
- The numbering is the same for any number of rows. The nine-slot menu is the first row of the chest, 54 is all six; neither does the numbers move, and the six rows are the same window as the large trunk.
- In the click handler, the numbers continue. getSlot() Gives the number inside the equipment on which it was clicked, and the bottom has this numbering of the player -- that is, zero comes from both the verstack result and the first rapid access cell. Distinguishes them getRawSlot(): It is unique for the entire window.
- The player's inventory shift is different for each window. After the chest it starts from 27, after the funnel - from 5, after the dispenser - from 9. The hard-shelled “27” lies everywhere except the chest.
- Clicking past the window is −999. A lot with this number doesn't exist in any inventory, so the game says that the object was thrown out of all the slots. A processor who doesn't expect a negative number falls on him with ArrayIndexOutOfBoundsException.
Frequently asked questions
What is the number of the central menu cell for 27 slots?
13. Counting starts from zero, so the second row of the chest starts at nine, and the middle of the three-row menu falls on the thirteenth slot.
Why is the item in the wrong slot?
Most often because of the player's equipment: rapid access 0–8 is drawn by OVLU and slots 9–35 above it. In the click processor, the numbering continues in addition to the window rather than the container.
What does slot −999 mean?
A click past a window. A lot with this number doesn't exist in any inventory, and a processor who doesn't expect a negative number falls on it with a mistake.
