Skip to content
ASArcaneMP Scripting APIScripting reference
Global objectServer APIGenerated

Lootables

const Lootables: object

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

Server-owned loot: chests opened with F, moonstone deposits broken with a spell, foragables picked up with F. A take is accepted only from a player the lootable streams to, standing within 25 m of it (150 m of a deposit, which a spell breaks from range), and only up to what they see; it is adopted into their inventory automatically. Who may loot what, respawns and persistence are the gamemode’s: use views and lootableTaken.

get(id): LootableState | null

One lootable by id.

number

LootableState | null

getView(id, player): LootableContents | null

The player’s view, or null when they see the lootable’s own contents.

number

Player

LootableContents | null

list(): LootableState[]

Every server-owned lootable.

LootableState[]

place(kind, x, y?, z?, yaw?, options?): number

Places a lootable for every client and returns its id, 0 on failure. An empty or locked moonstone shows mined out, an empty or locked foragable picked.

"chest" | "moonstone" | "foragable"

number | Vector3Like

number

number

number

mode defaults to “shared”. open (chests only) holds the lid as setOpen does; left out, the game moves it. virtualWorld and map place it in that world of that map, as setVirtualWorld does for an entity (default world 0 of the shared map). model is a Blueprint class path; it defaults to a Hogwarts chest, a small moonstone deposit, or the foragable that gives the item. Moonstones take BP_Moonstone_S/M/L and foragables the five shipped foragable Blueprints only. Moonstones and foragables hold plain items only, and a foragable one stack.

LootItem[]

boolean

string

"shared" | "perPlayer"

string

boolean

number

number

remove(id): boolean

Removes it from every client.

number

boolean

setItems(id, items): boolean

Replaces what every player without a view sees; an empty list empties it.

number

LootItem[]

boolean

setLocked(id, locked): boolean

Locks or unlocks it for every player without a view.

number

boolean

boolean

setMode(id, mode): boolean

Shared: a take empties it for everyone. PerPlayer: a take empties only the taker’s view.

number

"shared" | "perPlayer"

boolean

setOpen(id, open): boolean

Swings a chest’s lid open (with its open sound) or shut for every player, and holds it there: an empty chest stays shut, and the lid swings back after a player loots it. A chest that streams in shows the lid already there. Throws for a moonstone or foragable.

number

boolean

boolean

setView(id, player, view): boolean

Overrides what one player sees in it. Views last for the connection: a gamemode keeping them across reconnects re-applies them.

number

Player

{ items?: LootItem[]; locked?: boolean; } | null

Fields left out keep the lootable’s own value; null drops the view.

boolean