Skip to content
ASArcaneMP Scripting APIScripting reference
Runtime classServer APIGenerated

Collider

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

An invisible shell of a shape that stops characters, spells or both, on every client near it. It is hollow: anyone inside when it appears stays inside, and a spell cast from inside meets its wall. A bolt that hits it ends there with its impact effect, or flies on off it with options.deflect. Players who pass it (setCollisionFor, options.only or options.except) walk through it, and their bolts fly through it. Movement is the client’s own, so a modified client can ignore it. A resource’s colliders are destroyed when it stops.

new Collider(id): Collider

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

Wraps a collider id; see valid.

number

Network id of the collider.

Collider

destroy(): boolean

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

Destroys the collider.

boolean


getBlocks(): ("characters" | "spells")[]

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

What it stops; empty once destroyed.

("characters" | "spells")[]


getShape(): ZoneShape | null

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

Its shape as created; null once destroyed.

ZoneShape | null


hasCollisionFor(player): boolean

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

Whether it stops the player and their bolts.

Player

boolean


setCollisionFor(player, enabled): boolean

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

Changes whether it stops one player, on every client. A player’s setting ends when they leave. False when the collider is gone, the player has left, or 64 players are already named.

Player

boolean

false lets the player and their bolts through; true stops them.

boolean


static create(key, shape, options?): Collider

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

Creates or replaces a collider. Throws a TypeError on a bad shape or option, and an Error at 1024 colliders.

string

Stable key; creating again replaces the collider.

ZoneShape

Its shape, as Zone takes one. A polygon with minZ equal to maxZ is a flat floor.

ColliderOptions

What it stops, who passes, its tint and where it exists.

Collider


static destroy(key): boolean

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

Destroys the collider under a key.

string

Key passed to create.

boolean


static get(key): Collider | undefined

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

The collider under a key.

string

Key passed to create.

Collider | undefined


static getAll(): Collider[]

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

Every collider, oldest first.

Collider[]

readonly deflect: "" | "mirror"

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

How it deflects bolts (options.deflect); empty when they end on it or once destroyed.


readonly id: number

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

Network id of the collider, unique while it exists.


readonly key: string

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

The key it was created under; empty once destroyed.


readonly type: "" | "sphere" | "box" | "cylinder" | "polygon"

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

Its shape’s type; empty once destroyed.


readonly valid: boolean

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

Whether the collider still exists.