methods relating to the player Inventroy

  • Short list again of some methods that would be helpful:


    • Inventory.isFull(Inventory.SlotType slotType) returns a boolean true or false if the specific inventory type is full.
    • Inventory.hasSpace(Inventory.SlotType slotType) returns a boolean true or false if the specific inventory type has space i.e. at least one empty slot.
  • These functions would be very useful! However, first we need to find out what "inventory is full" actually means. Basically it depends on the item you want to add to the inventory. For example, if every slot in your inventory is occupied by a single tomato, the inventory can be considered as "full" if you want to add a pickaxe (since there is no room for a pickaxe), however, if you want to add another tomato, it actually works (it will be added to one of the existing tomato stacks, so the inventory can't be considered as "full" in this case) ^^

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!