Skip to content
ASArcaneMP Scripting APIScripting reference
Data shapeServer APIGenerated

PlayerInventory

Defined in: server/api.d.ts:1484

Server-authoritative controller returned by Player.inventory.

adoptNative(adoptionId, options?, callback?): void

Defined in: server/api.d.ts:1543

Deliberately imports one exact playerInventoryNativeDelta after revalidating it.

string

NativeInventoryAdoptionOptions

InventoryCallback

void


clear(callback?): void

Defined in: server/api.d.ts:1523

Removes every row, as one revision.

InventoryCallback

void


count(itemId): number

Defined in: server/api.d.ts:1553

How many of an item the rows hold.

string

number


give(itemId, count?, options?, callback?): void

Defined in: server/api.d.ts:1503

Adds count (default 1) of an item.

string

number

InventoryOptions

InventoryCallback

void


has(itemId, count?): boolean

Defined in: server/api.d.ts:1558

Whether the rows hold at least count (default 1) of an item.

string

number

boolean


list(): InventoryItem[]

Defined in: server/api.d.ts:1528

Every row of the server-authoritative inventory.

InventoryItem[]


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.

string

InventoryMoveOptions

InventoryCallback

void


native(): NativeInventoryState | null

Defined in: server/api.d.ts:1533

Full client-reported native inventory, or null before its first report.

NativeInventoryState | null


patch(operations, options?, callback?): void

Defined in: server/api.d.ts:1513

Applies all operations atomically and publishes exactly one revision/native snapshot.

InventoryPatchOperation[]

InventoryPatchOptions

InventoryCallback

void


remove(itemId, count?, options?, callback?): void

Defined in: server/api.d.ts:1508

Removes count (default 1) of an item.

string

number

InventoryOptions

InventoryCallback

void


replace(items, callback?): void

Defined in: server/api.d.ts:1498

Replaces every row with items, as one revision.

InventoryItem[]

InventoryCallback

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.

string

InventoryUseOptions

InventoryCallback

number


waitForRevision(revision): Promise<NativeInventoryState>

Defined in: server/api.d.ts:1538

Waits for terminal native application of this revision or a newer full snapshot.

number

Promise<NativeInventoryState>

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.


readonly revision: number

Defined in: server/api.d.ts:1488

Current server-authoritative revision for optimistic transactions.