Guide 1 Docs 2 Reference 3
5

Container type

A chest's stacks: world.container(pos). A chest a player has open is theirs until it closes — take takes nothing, put puts nothing.

Functions 3

container:items() → { InventorySlot & { slot: number } }

The filled slots, in order.

container:take(item: ItemMatch, count: number?) → number

Up to count (1 unless you say) of what matches; how many it took.

container:put(item: ItemSpec) → number

How many did not fit; 0 when all of it went in.

Fields 2