PlayerInventory
Defined in: server/api.d.ts:1484
Server-authoritative controller returned by Player.inventory.
Methods
Section titled “Methods”adoptNative()
Section titled “adoptNative()”adoptNative(
adoptionId,options?,callback?):void
Defined in: server/api.d.ts:1543
Deliberately imports one exact playerInventoryNativeDelta after revalidating it.
Parameters
Section titled “Parameters”adoptionId
Section titled “adoptionId”string
options?
Section titled “options?”NativeInventoryAdoptionOptions
callback?
Section titled “callback?”Returns
Section titled “Returns”void
clear()
Section titled “clear()”clear(
callback?):void
Defined in: server/api.d.ts:1523
Removes every row, as one revision.
Parameters
Section titled “Parameters”callback?
Section titled “callback?”Returns
Section titled “Returns”void
count()
Section titled “count()”count(
itemId):number
Defined in: server/api.d.ts:1553
How many of an item the rows hold.
Parameters
Section titled “Parameters”itemId
Section titled “itemId”string
Returns
Section titled “Returns”number
give()
Section titled “give()”give(
itemId,count?,options?,callback?):void
Defined in: server/api.d.ts:1503
Adds count (default 1) of an item.
Parameters
Section titled “Parameters”itemId
Section titled “itemId”string
count?
Section titled “count?”number
options?
Section titled “options?”callback?
Section titled “callback?”Returns
Section titled “Returns”void
has(
itemId,count?):boolean
Defined in: server/api.d.ts:1558
Whether the rows hold at least count (default 1) of an item.
Parameters
Section titled “Parameters”itemId
Section titled “itemId”string
count?
Section titled “count?”number
Returns
Section titled “Returns”boolean
list()
Section titled “list()”list():
InventoryItem[]
Defined in: server/api.d.ts:1528
Every row of the server-authoritative inventory.
Returns
Section titled “Returns”move()
Section titled “move()”move(
itemId,options,callback?):void
Defined in: server/api.d.ts:1518
Holder-move sugar over a one-operation patch; active mount moves swap the old occupant to storage.
Parameters
Section titled “Parameters”itemId
Section titled “itemId”string
options
Section titled “options”callback?
Section titled “callback?”Returns
Section titled “Returns”void
native()
Section titled “native()”native():
NativeInventoryState|null
Defined in: server/api.d.ts:1533
Full client-reported native inventory, or null before its first report.
Returns
Section titled “Returns”NativeInventoryState | null
patch()
Section titled “patch()”patch(
operations,options?,callback?):void
Defined in: server/api.d.ts:1513
Applies all operations atomically and publishes exactly one revision/native snapshot.
Parameters
Section titled “Parameters”operations
Section titled “operations”options?
Section titled “options?”callback?
Section titled “callback?”Returns
Section titled “Returns”void
remove()
Section titled “remove()”remove(
itemId,count?,options?,callback?):void
Defined in: server/api.d.ts:1508
Removes count (default 1) of an item.
Parameters
Section titled “Parameters”itemId
Section titled “itemId”string
count?
Section titled “count?”number
options?
Section titled “options?”callback?
Section titled “callback?”Returns
Section titled “Returns”void
replace()
Section titled “replace()”replace(
items,callback?):void
Defined in: server/api.d.ts:1498
Replaces every row with items, as one revision.
Parameters
Section titled “Parameters”callback?
Section titled “callback?”Returns
Section titled “Returns”void
use(
itemId,options?,callback?):number
Defined in: server/api.d.ts:1548
Uses one native potion/plant and completes only after the game proves its exact decrement.
Parameters
Section titled “Parameters”itemId
Section titled “itemId”string
options?
Section titled “options?”callback?
Section titled “callback?”Returns
Section titled “Returns”number
waitForRevision()
Section titled “waitForRevision()”waitForRevision(
revision):Promise<NativeInventoryState>
Defined in: server/api.d.ts:1538
Waits for terminal native application of this revision or a newer full snapshot.
Parameters
Section titled “Parameters”revision
Section titled “revision”number
Returns
Section titled “Returns”Promise<NativeInventoryState>
Properties
Section titled “Properties”gearCapacity
Section titled “gearCapacity”gearCapacity:
number|null
Defined in: server/api.d.ts:1493
Total gear slots the player is held to; each clothing or gear piece takes one. null (the default) keeps the game’s own limit: 20, plus Merlin trial upgrades. Set 1-200. Gear already past it is kept; the game refuses only new pieces. It rides the next inventory snapshot ahead of that snapshot’s rows, so set it before granting gear. Per connection, like the rows.
revision
Section titled “revision”
readonlyrevision:number
Defined in: server/api.d.ts:1488
Current server-authoritative revision for optimistic transactions.