Bukkit Inventory Slot Numbers

admin
Bukkit Inventory Slot Numbers Rating: 3,9/5 2618 reviews
NumbersInventory

Bukkit Inventory Slot Numbers List

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. 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. Inventory invGUI = Bukkit.createInventory(null, 27, 'Custom Inventory'). (1 through 20 I believe) with each number assigned to the slot number (0-8, 17, 26-18,9. Anyone know the ID of the Helmet slot in the normal Inventory?

Bukkit Inventory Slot Numbers Free

Bukkit inventory slot numbers list
All Superinterfaces:
Inventory, Iterable<ItemStack>
Interface to the inventory of a Player, including the four armor slots and any extra slots.
  • Method Summary

    Modifier and TypeMethodDescription
    ItemStack[]getArmorContents()
    ItemStackgetBoots()
    Return the ItemStack from the boots slot
    ItemStackgetChestplate()
    ItemStack[]getExtraContents()
    Get all additional ItemStacks stored in this inventory.
    intgetHeldItemSlot()
    ItemStackgetHelmet()
    Return the ItemStack from the helmet slot
    HumanEntitygetHolder()
    Gets the block or entity belonging to the open inventory
    ItemStackgetItem​(EquipmentSlot slot)
    Gets the ItemStack at the given equipment slot in the inventory.
    ItemStackgetItemInHand()
    Deprecated.
    players can duel wield now use the methods for thespecific hand instead
    ItemStackgetItemInMainHand()
    Gets a copy of the item the player is currently holdingin their main hand.
    ItemStackgetItemInOffHand()
    Gets a copy of the item the player is currently holdingin their off hand.
    ItemStackgetLeggings()
    voidsetArmorContents​(ItemStack[] items)
    Put the given ItemStacks into the armor slots
    voidsetBoots​(ItemStack boots)
    voidsetChestplate​(ItemStack chestplate)
    Put the given ItemStack into the chestplate slot.
    voidsetExtraContents​(ItemStack[] items)
    Put the given ItemStacks into the extra slots
    See getExtraContents() for an explanation of extra slots.
    voidsetHeldItemSlot​(int slot)
    voidsetHelmet​(ItemStack helmet)
    Put the given ItemStack into the helmet slot.
    voidsetItem​(int index,ItemStack item)
    Stores the ItemStack at the given index of the inventory.
    voidsetItem​(EquipmentSlot slot,ItemStack item)
    Stores the ItemStack at the given equipment slot in the inventory.
    voidsetItemInHand​(ItemStack stack)
    Deprecated.
    players can duel wield now use the methods for thespecific hand instead
    voidsetItemInMainHand​(ItemStack item)
    Sets the item the player is holding in their main hand.
    voidsetItemInOffHand​(ItemStack item)
    Sets the item the player is holding in their off hand.
    voidsetLeggings​(ItemStack leggings)

    Methods inherited from interface org.bukkit.inventory.Inventory

    addItem, all, all, clear, clear, contains, contains, contains, contains, containsAtLeast, first, first, firstEmpty, getContents, getItem, getLocation, getMaxStackSize, getSize, getStorageContents, getType, getViewers, isEmpty, iterator, iterator, remove, remove, removeItem, setContents, setMaxStackSize, setStorageContents

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Method Details

    • getArmorContents

      Get all ItemStacks from the armor slots
      Returns:
      All the ItemStacks from the armor slots. Individual items can be null.
    • getExtraContents

      Get all additional ItemStacks stored in this inventory.
      NB: What defines an extra slot is up to the implementation, however itwill not be contained within Inventory.getStorageContents() orgetArmorContents()
      Returns:
      All additional ItemStacks. Individual items can be null.
    • getHelmet

      Return the ItemStack from the helmet slot
      Returns:
      The ItemStack in the helmet slot
    • getChestplate

      Return the ItemStack from the chestplate slot
      Returns:
      The ItemStack in the chestplate slot
    • getLeggings

      Return the ItemStack from the leg slot
      Returns:
      The ItemStack in the leg slot
    • getBoots

      Return the ItemStack from the boots slot
      Returns:
      The ItemStack in the boots slot
    • setItem

      Stores the ItemStack at the given index of the inventory.

      Indexes 0 through 8 refer to the hotbar. 9 through 35 refer to the main inventory, counting up from 9 at the topleft corner of the inventory, moving to the right, and moving to the row below it back on the left side when itreaches the end of the row. 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.

      Index 40 refers to the off hand (shield) item slot. Though you can set off hand with this method using this index,you are encouraged to use the provided method for this slot.

      If you attempt to use this method with an index less than 0 or greater than 40, an ArrayIndexOutOfBoundsexception will be thrown.

      Specified by:
      setItem in interface Inventory
      Parameters:
      index - The index where to put the ItemStack
      item - The ItemStack to set
      Throws:
      ArrayIndexOutOfBoundsException - when index < 0 index > 40
      See Also:
      setBoots(ItemStack),setChestplate(ItemStack),setHelmet(ItemStack),setLeggings(ItemStack),setItemInOffHand(ItemStack)
    • setItem

      voidsetItem​(@NotNullEquipmentSlot slot,@NullableItemStack item)
      Stores the ItemStack at the given equipment slot in the inventory.
      Parameters:
      slot - the slot to put the ItemStack
      item - the ItemStack to set
      See Also:
      setItem(int, ItemStack)
    • getItem

      @NotNullItemStackgetItem​(@NotNullEquipmentSlot slot)
      Gets the ItemStack at the given equipment slot in the inventory.
      Parameters:
      slot - the slot to get the ItemStack
      Returns:
      the ItemStack in the given slot
    • setArmorContents

      Put the given ItemStacks into the armor slots
      Parameters:
      items - The ItemStacks to use as armour
    • setExtraContents

      Put the given ItemStacks into the extra slots
      See getExtraContents() for an explanation of extra slots.
      Parameters:
      items - The ItemStacks to use as extra
    • setHelmet

      Put the given ItemStack into the helmet slot. This does not check ifthe ItemStack is a helmet
      Parameters:
      helmet - The ItemStack to use as helmet
    • setChestplate

      Put the given ItemStack into the chestplate slot. This does not checkif the ItemStack is a chestplate
      Parameters:
      chestplate - The ItemStack to use as chestplate
    • setLeggings

      Put the given ItemStack into the leg slot. This does not check if theItemStack is a pair of leggings
      Parameters:
      leggings - The ItemStack to use as leggings
    • setBoots

      Put the given ItemStack into the boots slot. This does not check if theItemStack is a boots
      Parameters:
      boots - The ItemStack to use as boots
    • getItemInMainHand

      Gets a copy of the item the player is currently holdingin their main hand.
      Returns:
      the currently held item
    • setItemInMainHand

      Sets the item the player is holding in their main hand.
      Parameters:
      item - The item to put into the player's hand
    • getItemInOffHand

      Gets a copy of the item the player is currently holdingin their off hand.
      Returns:
      the currently held item
    • setItemInOffHand

      Sets the item the player is holding in their off hand.
      Parameters:
      item - The item to put into the player's hand
    • getItemInHand

      Deprecated.
      players can duel wield now use the methods for thespecific hand instead
      Gets a copy of the item the player is currently holding
      Returns:
      the currently held item
      See Also:
      getItemInMainHand(),getItemInOffHand()
    • setItemInHand

      @DeprecatedvoidsetItemInHand​(@NullableItemStack stack)
      Deprecated.
      players can duel wield now use the methods for thespecific hand instead
      Parameters:
      stack - The item to put into the player's hand
      See Also:
      setItemInMainHand(ItemStack),setItemInOffHand(ItemStack)
    • getHeldItemSlot

      intgetHeldItemSlot()
      Returns:
      Held item slot number
    • setHeldItemSlot

      voidsetHeldItemSlot​(int slot)
      Set the slot number of the currently held item.

      This validates whether the slot is between 0 and 8 inclusive.

      Parameters:
      slot - The new slot number
      Throws:
      IllegalArgumentException - Thrown if slot is not between 0 and 8inclusive
    • getHolder

      Description copied from interface: Inventory
      Gets the block or entity belonging to the open inventory
      Specified by:
      getHolder in interface Inventory
      Returns:
      The holder of the inventory; null if it has no holder.