Bukkit Inventory 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.
/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. 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. If you use the PrepareAnvilEvent you can get the different items in an anvil inventory. If you use event.getResult you will get the item in the result slot. Or if you want to set the item in the result slot its event.setResult(itemstack); To get the two item that are in the Inventory you can use inventory.getItem(1) or inventory.getItem(2).
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:
/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
Bukkit Inventory Slot Numbers 2020
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