Bukkit Inventory Slot Numbers

 

The one in wiki shows slots used in communication between server and client and the one in this topic is Spigot(CraftBukkit) API. #7 aLTeR, Apr 26, 2016 + Quote Reply. Index of an an inventory slot. Other types of slots may or may not have indices. Note that comparing slots with numbers is also possible; if index of slot is same as the number, comparisonsucceeds. This expression is mainly for the cases where you must for some reason save the slot numbers. /useitem slot subindex Please Note: subitem is only used if the item is in a bag.Bag slot numbers start at 0, and go up left to right, top to bottom. Here's an easy example to use (i.e. Click) your right ring clickie. Finds all slots in the inventory containing any ItemStacks with the given ItemStack. This will only match slots if both the type and the amount of the stack match The HashMap contains entries where, the key is the slot index, and the value is the ItemStack in that slot. It follows the same path in the inventory like you would read a book. Indexes 36 through 39 refer to the armor slots. Though you can set armor with this method using these indexes, you are encouraged to use the provided methods for those slots.

  1. Bukkit Inventory Slot Numbers List

/useitem <slot> [subindex]

Please Note: [subitem] is only used if the item is in a bag. Bag slot numbers start at 0, and go up left to right, top to bottom.

Here's an easy example to use (i.e. click) your right ring clickie...

/useitem 16

Easy, huh? We need to put a few pauses in there to give the clickie time to click before moving on to the next step... so we're going to take our right ring clickie above, and add a back clickie to it. The ring takes .5 seconds to cast, so we are going to pause 6, which is equal to 6/10'ths of a second. This gives us a little play if we are experiencing lag. With the pause and the new clickie, our social will look like this:

Bukkit inventory slot numbers list

/pause 6, /useitem 16
/useitem 8

Remember, the /pause command is put before the line you want to put a pause in, but the pause actually happens after the other command on the line activates. Kind of backwards, but if you remember the order, you can make hotkeys a lot more user-friendly.

To add an inventory item in a bag to your hotkey example above. Say I have a clickie I use all the time, but it's stats aren't good enough for me to wear? Of course, you can click it from your bag, but then you have to open the bag, click the item and then close the bag, or make a shortcut to it, which takes a spot for each item. Not anymore, though. You can add it to your clickie social. In my example, I have an item in bag slot 1, in the top left-hand slot. The social will now look like this:

/pause 6, /useitem 16
/pause 6, /useitem 8
/useitem 23 0

Slot Codes

Bukkit Inventory Slot Numbers List

  • Charm = 0
  • Left Ear = 1
  • Head = 2
  • Face = 3
  • Right Ear = 4
  • Neck = 5
  • Shoulders = 6
  • Arms = 7
  • Back = 8
  • Left Wrist = 9
  • Right Wrist = 10
  • Range = 11
  • Hands = 12
  • Primary = 13
  • Secondary = 14
  • Left Ring = 15
  • Right Ring = 16
  • Chest = 17
  • Legs = 18
  • Feet = 19
  • Waist = 20
  • Power Source = 21
  • Ammo = 22
  • Bag Slot 1 = 23
  • Bag Slot 2 = 24
  • Bag Slot 3 = 25
  • Bag Slot 4 = 26
  • Bag Slot 5 = 27
  • Bag Slot 6 = 28
  • Bag Slot 7 = 29
  • Bag Slot 8 = 30
  • Bag Slot 9 = 31
  • Bag Slot 10 = 32