Interface IInventory

All Superinterfaces:
IItems<IInventoryItem>, ItemProvider<IInventoryItem>

public interface IInventory extends IItems<IInventoryItem>
Provides access to the player's inventory.

The inventory holds up to 28 items. This interface extends IItems to provide querying and interaction with inventory items, and adds inventory-specific methods for checking capacity.

Example usage:

 
 IInventory inventory = Static.getInventory();
 boolean hasFreeSpace = !inventory.isFull();
 int freeSlots = inventory.getFreeSlots();
 IInventoryItem item = inventory.first("Coins");
 
 

See Also:
  • Method Details

    • getFreeSlots

      int getFreeSlots()
      Gets the number of free (empty) slots in the inventory.
      Returns:
      the number of free slots (0-28)
    • isFull

      boolean isFull()
      Checks if the inventory is full (no free slots).
      Returns:
      true if the inventory is full, false otherwise