Skip to content
ASArcaneMP Scripting APIScripting reference
Global objectServer APIGenerated

LootSpots

const LootSpots: object

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

The game’s own Overland moonstone deposits and foragables under World.setLootPolicy(“server”): every spot the game spawns, as a lootable streamed to the players near it. A take empties it (for everyone, or under “perPlayer” for the taker) and is adopted into the taker’s inventory; it restocks after its kind’s respawn time. Spots are not Lootables: Lootables.list() leaves them out. Settings and depletion last for the server’s run. Event: lootSpotTaken(player, spotId, items).

readonly mode: "shared" | "perPlayer"

“shared” (the default: a take empties the spot for everyone) or “perPlayer” (a take empties it for the taker only).

get(id): LootSpotState | null

One spot, or null for an unknown id.

string

A spot id from getAll.

LootSpotState | null

getAll(): LootSpotState[]

Every spot in the catalog, whether its family runs or not.

LootSpotState[]

getKinds(): LootSpotKind[]

Every kind of spot with its current yield and respawn time.

LootSpotKind[]

getLootableId(id): number

The Lootables id the spot is placed as, for Lootables.setView or Lootables.get; it changes each time the spot is placed again.

string

number

0 while it is not placed, or for an unknown id.

reset(id): boolean

Restocks a spot now, for every player.

string

boolean

False for an unknown id.

setEnabled(id, enabled): boolean

Takes one spot out of the world or puts it back, stocked. Lasts for the server’s run: a gamemode keeping a list re-applies it at startup.

string

boolean

boolean

False for an unknown id.

setMode(mode): boolean

Sets what a take empties. A change restocks every spot; under “perPlayer” each player’s spot comes back after the respawn time from their own take.

"shared" | "perPlayer"

boolean

False for any other value.

setRespawnSeconds(seconds, kind?): boolean

Sets how long an emptied spot stays empty. The default, 4320, is the game’s own 3 in-game days at the default time scale; it does not follow World.setTimeScale. A spot already waiting keeps its time.

number

0 to a week.

string

A kind name, “moonstones” or “foragables”; every kind when left out.

boolean

False for an unknown kind or a value out of range.

setYield(count, kind?): boolean

Sets how many of its item a spot holds when it restocks. Stocked spots keep what they hold until their next restock.

number | [number, number]

A whole number, or a min and max rolled at each restock (1 to 1000).

string

A kind name, “moonstones” or “foragables”; every kind when left out.

boolean

False for an unknown kind or a count out of range.