ItemContainer

Group
player
Methods
7
Fields
None

Getting one

client:getItemContainer(…)

Methods

MethodReturnsDescription
getId()numberThe container's id (InventoryID), with 0x8000 for another player's.
getItems(){Item}Every slot's item, empty slots as id -1 quantity 0.
getItem(number)Item?The item in slot, or nil for an empty slot or one past the end.
contains(number)booleanWhether any slot holds itemId.
count(number)number(ItemContainer, number) -> number: How many of itemId the container holds: the quantity of the first slot of it holding more than one (…
count()number
size()numberHow many slots there are, empty ones included.
find(number)numberThe first slot holding itemId, or -1.

Returned by

MethodReturnsDescription
Client.getItemContainerItemContainer?(Client, number) -> ItemContainer?: Item container id (an InventoryID), or nil when the client has none.
ItemContainerChanged.getItemContainerItemContainer?The container, read live (nil only when the client removed it again before the event was delivered).

Method details

getId

getId: (ItemContainer) -> number

The container's id (InventoryID), with 0x8000 for another player's.

count

count: ((ItemContainer, number) -> number) & ((ItemContainer) -> number)

(ItemContainer, number) -> number: How many of itemId the container holds: the quantity of the first slot of it holding more than one (a stack), else the number of slots holding it (unstacked items, one each).

(ItemContainer) -> number: How many slots hold an item.