Lua API

LuaInventory classmod

Represents an item inventory, a list of items.

Methods

LuaInventory:has_free_slot () Queries whether the inventory has at least one free slot.
LuaInventory:stack (item) Stacks an item in the inventory indicated.

Methods

# LuaInventory:has_free_slot ()

Queries whether the inventory has at least one free slot.

Returns:
  • (True) if the inventory has at least one free slot; false if not.
# LuaInventory:stack (item)

Stacks an item in the inventory indicated.

The item will no longer be valid for use.

Parameters: Returns:
  • (LuaItem) The modified item stack on success
Or