Class PlayerInventory

java.lang.Object
org.geysermc.geyser.inventory.Inventory
org.geysermc.geyser.inventory.PlayerInventory

public class PlayerInventory extends Inventory
  • Constructor Details

    • PlayerInventory

      public PlayerInventory(GeyserSession session)
  • Method Details

    • getOffsetForHotbar

      public int getOffsetForHotbar(@org.jetbrains.annotations.Range(from=0L, to=8L) int slot)
      Specified by:
      getOffsetForHotbar in class Inventory
    • setCursor

      public void setCursor(@NonNull GeyserItemStack newCursor, GeyserSession session)
    • isHolding

      public boolean isHolding(@NonNull Item item)
      Checks if the player is holding the specified item in either hand
      Parameters:
      item - The item to look for
      Returns:
      If the player is holding the item in either hand
    • getItemInHand

      public GeyserItemStack getItemInHand(@NonNull org.geysermc.mcprotocollib.protocol.data.game.entity.player.Hand hand)
    • getItemInHand

      public GeyserItemStack getItemInHand()
    • getEquipment

      public Map<org.geysermc.mcprotocollib.protocol.data.game.entity.EquipmentSlot,GeyserItemStack> getEquipment()
    • setItemInHand

      public void setItemInHand(@NonNull GeyserItemStack item)
    • shouldConfirmContainerClose

      public boolean shouldConfirmContainerClose()
      Description copied from class: Inventory
      Whether we should be sending a ServerboundContainerClosePacket when closing the inventory.
      Overrides:
      shouldConfirmContainerClose in class Inventory
    • getOffhand

      public GeyserItemStack getOffhand()
    • getHeldItemSlot

      public int getHeldItemSlot()
      Stores the held item slot, starting at index 0. Add 36 in order to get the network item slot.
    • getCursor

      public @NonNull GeyserItemStack getCursor()
    • setHeldItemSlot

      public void setHeldItemSlot(int heldItemSlot)
      Stores the held item slot, starting at index 0. Add 36 in order to get the network item slot.