Skip to content
ASArcaneMP Scripting APIScripting reference
Runtime classServer APIGenerated

WandLink

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

Two players’ beams locked in the game’s own wand link: the beams meet at a clash point every client draws, and each player plays the wand-link clips. The script runs the contest through ratio/push and decides it with end().

  • ServerEntity.ServerEntity

new WandLink(id): WandLink

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

Wraps a wand link entity id without starting one.

number

Network id of the server entity to wrap.

WandLink

end(winner?): boolean

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

Ends the link. With a winner, the beam surges into the loser, who plays the fail clip while the winner plays the win clip; a cancel just releases both. Both players get their input back once the clips finish, and the entity is destroyed a few seconds later. Raises wandLinkEnded.

Player | null

The member who won; omit or null to cancel.

boolean

False when the link had already ended or the winner is not in it.


push(player, amount): number | null

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

Moves the clash point toward the opponent and plays a nudge at it on every client.

Player

The member pushing.

number

Ratio to move toward that player’s opponent; negative pulls back.

number | null

The new ratio, or null when the link is not active or the player is not in it.


setVirtualWorld(world): void

Defined in: shared.d.ts:80

Moves this entity into another virtual world.

number

void


setVisibleTo(player): void

Defined in: shared.d.ts:82

Restricts replication to one player’s connection, within the usual range and visibility checks; null lifts it.

Entity | null

void


toString(): string

Defined in: shared.d.ts:74

string


static of(player): WandLink | null

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

The active link a player is in.

Player

Player to look up.

WandLink | null


static start(a, b, opts?): WandLink

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

Links two players: both stop, turn to face each other and play the wand-link clips while beams join their wands. Throws when they cannot link: not connected, dead, mounted, already linked, in different worlds, or not 1.5 m to maxDistance apart.

Player

First member; the beam on its side uses the game’s player colors.

Player

Second member.

WandLinkStartOptions

Starting ratio (default 0.5) and maxDistance in world units (default 4000).

WandLink

readonly active: boolean

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

True until end() or a member leaves or dies.


readonly connected: boolean

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

True once the beams have met, about 3.7 s after start(): both players swing first, as in the game’s own wand link. Count a contest from here.


readonly id: number

Defined in: shared.d.ts:65

Network id, stable for the entity’s lifetime.


readonly playerA: Player | null

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

The first player passed to start(); null once the link is destroyed.


readonly playerB: Player | null

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

The second player passed to start(); null once the link is destroyed.


position: Vector3

Defined in: shared.d.ts:67

World position. Read, call set(...), then assign back.


ratio: number

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

Where the clash point sits between the wand tips: 0 at playerA’s, 1 at playerB’s, so it rises while playerA is winning. Clamped to [0, 1]; writes are ignored once the link has ended, and end(winner) leaves it at the loser’s end.


rotation: Vector3 | Quaternion

Defined in: shared.d.ts:69

Reads as a quaternion; assignments also accept Euler angles in degrees.


readonly state: StateBag

Defined in: shared.d.ts:71

This entity’s key/value state: the server writes it, and every client that can see the entity receives it. See StateBag.


readonly virtualWorld: number

Defined in: shared.d.ts:73

The virtual world this entity replicates in. Read-only: change it with setVirtualWorld on the server.


readonly winner: Player | null

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

The player end() named; null while active, after a cancel, or once destroyed.