Interface MainSpectatorInventory

All Superinterfaces:
Inventory, Iterable<ItemStack>, SpectatorInventory<PlayerInventorySlot>
All Known Subinterfaces:
MainInventory<NMS,Self>

public interface MainSpectatorInventory extends SpectatorInventory<PlayerInventorySlot>
A spectator inventory that contains all the items of the target player's 'normal' inventory. This includes the player's armour, items in his crafting grid, and even the item on his cursor!
  • Method Details

    • getStorageContents

      ItemStack[] getStorageContents()
      Get the items in the player's storage slots.
      Specified by:
      getStorageContents in interface Inventory
    • setStorageContents

      void setStorageContents(ItemStack[] storageContents)
      Set the items in the player's storage slots.
      Specified by:
      setStorageContents in interface Inventory
    • getArmourContents

      ItemStack[] getArmourContents()
      Get the items in the player's armour slots.
    • setArmourContents

      void setArmourContents(ItemStack[] armourContents)
      Change the items in the player's armour slots.
    • getOffHandContents

      ItemStack[] getOffHandContents()
      Get the items in the player's offhand. The length of array is usually 1.
    • setOffHandContents

      void setOffHandContents(ItemStack[] offHand)
      Set the items in the player's offhand. The length of this array must be equal to getOffHandContents().length.
    • setCursorContents

      void setCursorContents(ItemStack cursor)
      Set the item that is on the player's cursor.
    • getCursorContents

      ItemStack getCursorContents()
      Get the item that is on the player's cursor.
    • setPersonalContents

      void setPersonalContents(ItemStack[] craftingContents)
      Set the items that are in the player's crafting slots. If the target player has an anvil/crafting table/enchanting table/villager workstation opened, then the contents of that temporary container will be updated instead.
    • getPersonalContents

      ItemStack[] getPersonalContents()
      Get the items that are in the player's crafting slots. If the target player has an anvil/crafting/table/enchanting table/villager workstation opened, then the contents of that temporary container will be retrieved instead.
    • getPersonalContentsSize

      int getPersonalContentsSize()
      Get the length of the getPersonalContents() array.
    • getMirror

      default Mirror<PlayerInventorySlot> getMirror()
      Get the mirror this inventory is viewed through.
      Specified by:
      getMirror in interface SpectatorInventory<PlayerInventorySlot>
    • setContents

      default void setContents(MainSpectatorInventory newContents)
      Set the contents of this inventory based on the contents from the provided inventory.