Interface ViewableInventory

All Superinterfaces:
Inventory, ValueContainer
All Known Subinterfaces:
BlockEntityInventory<T>, ViewableInventory.Custom

public interface ViewableInventory extends Inventory
Interface for inventories which may be interacted with by Players.
  • Method Details

    • viewers

      Set<ServerPlayer> viewers()
      Gets the current viewers looking at this Inventory.
      The current viewers of this inventory
    • hasViewers

      boolean hasViewers()
      Checks for whether this Inventory currently has viewers.
      True if viewers are currently looking at this inventory
    • canInteractWith

      boolean canInteractWith(ServerPlayer player)
      Gets whether the specified player can interact with this object.
      player - the Player wishing to interact with this Inventory
      true if the Entity is able to interact with this Inventory
    • asMenu

      InventoryMenu asMenu()
      Create a new InventoryMenu based on this ViewableInventory which allows for lightweight callbacks on inventory clicks and changes. To receive callbacks the inventory must be opened from
      The new InventoryMenu
    • builder

      static ViewableInventory.Builder builder()
      Creates a new ViewableInventory.Builder to build an ViewableInventory.
      The builder