Interface: PlayerInventory
Mutable main inventory of one player.
Properties
emptySlotsCount
readonlyemptySlotsCount:number
Number of empty inventory slots.
size
readonlysize:number
Number of available inventory slots.
Methods
addItem()
addItem(
itemStack):ItemStack|null
Adds a stack and returns the remainder that did not fit, if any.
Parameters
itemStack
Returns
ItemStack | null
capture()
capture(
options?):InventorySnapshot
Captures a detached snapshot of selected player inventory state.
Parameters
options?
InventorySnapshotOptions | null
Returns
clear()
clear():
void
Clears every main-inventory slot.
Returns
void
getItem()
getItem(
slot):ItemStack|null
Returns a detached copy of a slot, or null when empty.
Parameters
slot
number
Returns
ItemStack | null
replaceTemporarily()
replaceTemporarily(
loadout,options?):InventoryLease
Replaces inventory state under a recoverable Script-Owned lease.
Parameters
loadout
options?
InventoryLeaseOptions | null
Returns
restore()
restore(
snapshot):void
Restores a previously captured snapshot.
Parameters
snapshot
Returns
void
setItem()
setItem(
slot,itemStack?):void
Replaces or clears one slot.
Parameters
slot
number
itemStack?
ItemStack | null
Returns
void