Skip to content
ASArcaneMP Scripting APIScripting reference
Runtime classServer APIGenerated

Player

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

A connected ArcaneMP player handle.

new Player(id): Player

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

Wraps a connected player entity id.

number

Network id of the connected player to wrap.

Player

BasePlayer.constructor

beastSeat(): { beast: Beast; seat: "rider" | "passenger"; } | null

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

The beast this player rides (beast.mount, once seated) or sits on behind its rider (beast.setPassenger), or null.

{ beast: Beast; seat: "rider" | "passenger"; } | null


cancelAbility(channel?): void

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

Ends whatever ability holds that channel on this player, on every client.

string

The Able channel to clear; “PartialBody” by default.

void


clearProp(key?): void

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

Takes the prop held under that key off this player’s body, on every client; props under other keys stay. Throws a TypeError for a key that is not a string, and a RangeError for one over 32 characters.

string

The key the prop was equipped under; omitted, the keyless prop.

void


emit(eventName, payloadJson?): void

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

Emits a named script event to this player’s client connection. Throws when the name is over 1 KiB or the payload over 1 MiB.

string

Client event name.

string

Optional JSON payload forwarded verbatim to the owning client, at most 1 MiB.

void

BasePlayer.emit


endKneel(): boolean

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

Stands this kneeling player up now, at the health the kneel’s own timer gives back: full, with the game’s own tuning. A kneel held by Pvp rules kneelSeconds 0 waits for this. playerDownedEnded follows once they are up; set a lower health there.

boolean

False when the player is not kneeling.


equipProp(path, options?): void

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

Attaches a mesh to a socket of this player’s body, replacing the prop held under the same key, the way LocalPlayer.equipProp does on their own client; every other player sees it, players who arrive later included. Props under different keys are held together, 6 at most with the keyless one, and two keys may share a socket. Their client refuses it without a body, or a seventh key, and getProp and getProps follow once it has applied it. The default socket is the wand’s, so take the wand away or name another. Throws a RangeError for a path that is not an asset path or a key over 32 characters, a TypeError for a key that is not a string, and an Error for malformed materials.

string

A StaticMesh or SkeletalMesh asset path.

PropOptions

key defaults to “”, the keyless prop; socket to “WandSocket”; offset is relative to the socket.

void


fastTravel(name): number

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

Queues a named fast-travel hop on this player’s client. For a map without a fast-travel point, travelToMap.

string

A known fast-travel destination name (case-insensitive).

number

Request id reported by playerFastTravelCompleted, or 0 when the name is unknown.


fastTravelAsync(name): Promise<{ requestId: number; status: number; }>

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

fastTravel, awaited: resolves with the request id and status playerFastTravelCompleted also carries. Rejects for an unknown name, and when the player disconnects first.

string

A known fast-travel destination name (case-insensitive).

Promise<{ requestId: number; status: number; }>

The completion.


finishActivity(): void

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

Ends this player’s activity the way LocalPlayer.finishActivity does on their own client: its companion goes off its own way and the outro plays.

void


follow(target, options): boolean

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

Walks this player after another, keeping distanceCm behind them, until stopped, replaced, expired or the target is lost. Ends with playerMoveEnded.

number | Player

Another player, or their id.

PlayerMoveOptions

Owner tag plus gait or speed, distanceCm, ttlMs, path and lockInput.

boolean

False when either player has no live character. Throws on bad input.


getActivity(): { id: ActivityId; variant: "" | ActivityVariant; } | null

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

This player’s activity and its variant (“” for one without variants) as their client last reported it, or null when none is under way.

{ id: ActivityId; variant: "" | ActivityVariant; } | null


getAnimalAttack(): { attack: string; id: number; phase: AnimalAttackPhase | null; } | null

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

The attack under way, and the last phase its owner reported (null before the first), or null.

{ attack: string; id: number; phase: AnimalAttackPhase | null; } | null


getAnimalForm(): { color: string; gender: "male" | "female"; look: "species" | "cat"; scale: number; size: number; species: AnimalFormSpecies; } | null

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

The animal this player wears (see setAnimalForm), its color and gender, and the full scale it wears for it, or null.

{ color: string; gender: "male" | "female"; look: "species" | "cat"; scale: number; size: number; species: AnimalFormSpecies; } | null


getAutoRespawn(): boolean

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

Whether this player respawns on their own after dying (see setAutoRespawn).

boolean


getCosmetics(): Record<string, CosmeticInfo>

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

Every filled cosmetic slot of this player and what setCosmetic put there, in the order the slots were filled, hidden ones included; empty when they wear none or are not connected.

Record<string, CosmeticInfo>


getFacialEmotion(): FacialEmotion | null

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

The expression setFacialEmotion holds on this player, or null.

FacialEmotion | null


getFastTravelEnabled(): boolean

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

Whether this player may fast travel from their map (see setFastTravelEnabled).

boolean


getFastTravelUnlocked(): string[]

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

The Floo flames lit on this player’s map, by FastTravelLocations id: the ones their game reported lit, with this server’s setFastTravelUnlocked calls applied at once. Client-reported, like position. Empty until their world first loads; a new connection starts from the game’s own set again.

string[]


getIP(): string

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

Returns this player’s current remote network address.

string

Address string, or an empty string when the player or peer is unavailable.

BasePlayer.getIP


getKeepHealthOnTravel(): boolean

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

Whether this player’s health is carried over map loads (see setKeepHealthOnTravel).

boolean


getLook(): LookJson | null

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

Returns this player’s worn appearance as plain ids under the creator’s category names. Persist it (JSON.stringify) to save a look and hand it back to setLook to restore it. Its gear ids and hood describe the worn items for other players; on the player’s own character those come from the inventory rows (appearanceOverride, hoodUp), so persist the inventory to keep them. Never includes a transmog.

LookJson | null

The look, or null when there’s no live player appearance.


getMapDiscovery(): string | null

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

How much of the world map this player has uncovered, as opaque text (about 5 KB) to store per character and pass back to setMapDiscovery: the fog of war their game reported, with this server’s setMapDiscovery calls applied at once. Client-reported. Null until their world first loads; a new connection starts from the game’s own map again. The overland world map only: dungeons keep their own fog.

string | null


getNametagColor(): number

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

Reads this player’s nametag color.

number

Packed 0xAARRGGBB color; opaque white when untinted.

BasePlayer.getNametagColor


getNametagText(): string

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

Reads this player’s nametag text override.

string

The override, or an empty string when the player’s own name is drawn.

BasePlayer.getNametagText


getPerch(): PerchInfo | null

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

The animal on this player’s shoulder (see setPerch), or null.

PerchInfo | null


getProp(): HeldProp | null

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

The keyless prop (equipped without a key) as this player’s client last reported it, or null when none is held; getProps lists the keyed ones too.

HeldProp | null


getProps(): HeldProp[]

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

Every prop this player holds, keyed or not, as their client last reported them, in the order they took their slots.

HeldProp[]


getPvpFlag(): boolean

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

Whether this player has PvP flagged on (see setPvpFlag). A deferred unflag still reads true until it lands.

boolean


getPvpTeam(): string | null

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

This player’s PvP team, or null when they have none.

string | null


getScale(): number

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

Returns this player’s character scale: the human’s own, also while an animal form is worn.

number

The scale, or 1 when never set.


getScaleMode(): "full" | "visual"

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

Returns how this player’s scale is applied (see setScale).

"full" | "visual"

“full” unless setScale chose “visual”.


getSkinFx(): string | null

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

The skin effect setSkinFx holds on this player, or null.

string | null


getSpawn(): { position: { x: number; y: number; z: number; }; yaw: number; } | null

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

This player’s own spawn point (setSpawn), or null when World.spawn applies.

{ position: { x: number; y: number; z: number; }; yaw: number; } | null


getTransmog(): string

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

Returns the active transmog character id.

string

The character id, or “” when none.


getWandGlow(): { b: number; g: number; r: number; } | null

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

The tint setWandGlow holds on this player, as it was stored (8 bits a channel), or null.

{ b: number; g: number; r: number; } | null


hideUI(name): void

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

Destroys this player’s name view (opened via showUI).

string

The view handle opened via showUI.

void


hold(options): boolean

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

Holds this player at a server-owned anchor: their streamed position is clamped before it lands, so every other client sees the anchor.

HoldOptions

Owner tag plus either a fixed x/y/z anchor or an anchorId to follow.

boolean

True when the hold was applied.


holds(): PlayerHold[]

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

Lists every live hold on this player, for diagnostics and for checking before acting.

PlayerHold[]


isCollidable(): boolean

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

Whether this player takes part in player collision (see setCollidable). True unless setCollidable(false).

boolean


isCrouching(): boolean

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

Whether this player is crouched, as their client last reported: by setCrouching or by one of the game’s crawl spaces.

boolean


isDead(): boolean

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

Whether this player is dead: true from playerDied until they are back up (playerDownedEnded).

boolean


isInvulnerable(): boolean

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

Whether the server holds this player immune (see setInvulnerable).

boolean


isNametagHealthVisible(): boolean

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

Checks whether the health bar under this player’s nametag is shown.

boolean

True unless the health bar was hidden; false also when this game has no nametags.

BasePlayer.isNametagHealthVisible


isNametagVisible(): boolean

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

Checks whether this player’s nametag is shown to other players.

boolean

True unless the nametag was hidden; false also when this game has no nametags.

BasePlayer.isNametagVisible


isRagdoll(): boolean

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

Whether this player lies in ragdoll while alive, as their client last reported: by setRagdoll or knocked down by the game.

boolean


isVisible(): boolean

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

Whether other players can see this player (see setVisible).

boolean


isVisibleFor(viewer): boolean

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

Whether viewer sees this player: their setVisibleFor override, else setVisible. True for the player themselves.

Player

boolean


kick(reason?): void

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

Disconnects this player from the server.

string

Optional reason shown to the disconnected player; omitting it uses the generic kicked reason.

void

BasePlayer.kick


launch(x, y?, z?, opts?): boolean

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

Launches the player: sets their velocity in cm/s (added to the current one unless opts.overrideXY / overrideZ) and puts them in the air, on their client. True when sent. No effect while a cutscene or mount holds their movement; a root-motion animation can override the horizontal part.

number | Vector3

X component, or the whole vector.

number

Y component.

number

Z component.

PhysicsCommandOptions

space (‘world’ | ‘local’), at, velocityChange, addToCurrent, overrideXY, overrideZ.

boolean


location(): PlayerLocation | null

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

Returns the player’s current game-authored area and region together with the latest replicated transform. The coordinate-space identifiers are client-observed and should be trusted like player position.

PlayerLocation | null

Null until the owning client reaches a playable world, and while it is changing worlds.


moveTo(x, y?, z?, options?): boolean

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

Walks this player to a point with the game’s own walk: their client steers the stick its on-foot controls read, so every client sees a normal walk. Ends with playerMoveEnded. A modified client can ignore it; pair it with hold() where that matters.

number | Vector3Like

number

number

A player’s origin, the same convention as position.

PlayerMoveOptions

Required. Owner tag plus gait or speed, acceptRadius, ttlMs, path and lockInput.

boolean

False when the player has no live, connected character. Throws on bad input.


moving(): PlayerMoving | null

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

The drive this player is walking, or null.

PlayerMoving | null


playAbility(classPath, channel?): void

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

Plays an Able ability on this player through the game’s own PlayAbilityByClass, the way LocalPlayer.playAbility does on their own client; every other player sees it. The partial-body abilities play over walking. An ability with no length of its own holds its channel until cancelAbility. Throws on a path that is not an ability class path.

string

An Able ability class path ending ‘_C’, e.g. ‘/Game/Pawn/Student/Abilities/PartialBody/Waving/ABL_Waving.ABL_Waving_C’.

string

The Able channel: “FullBody” (default) or “PartialBody”.

void


playAnimalAttack(attack): number

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

Plays one of the worn enemy’s own attacks on its body, on every client drawing this player and their own: the troll’s club swing, overhead smash, rage slam and rock throw, a wolf’s bites, a spider’s bite and spit, and so on. It is presentation only: the game’s animation, props (the troll’s rock in its hand) and effects play, but nothing is hit and nothing is thrown, so the script decides what lands. The body faces where the player faces and attacks the ground in front of it. A new attack interrupts the one under way, and a new form, death or a disconnect ends it; playerAnimalAttack follows it from started to ended, interrupted or failed. Their client cannot refuse it, but a modified one can lie about how it went.

string

One of the worn species’ attacks, as Player.animalForms() lists them (“swing”, “throw” for a troll).

number

The attack’s id, as playerAnimalAttack reports it. Throws a RangeError when the player wears no form, or one without that attack.


playClip(clipPath, options?): void

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

Plays an AnimSequence on this player the way LocalPlayer.playClip does on their own client, replacing the clip they play; every other player sees it, players who arrive later included. It holds the whole body and ends when they move. Their client refuses it without a body, and the clip property follows once it plays. Throws on a path that is not an asset path or a rate out of range.

string

An AnimSequence asset path, e.g. ‘/Game/Animation/Human/Hu_Crouch_RF_Idle_anm.Hu_Crouch_RF_Idle_anm’.

loop defaults true; hold (a one-shot keeps its last frame) defaults true; rate is 0.01..10, default 1.

boolean

boolean

number

void


release(owner): boolean

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

Drops only this owner’s hold on the player.

string

The owner tag passed to hold().

boolean

True when that owner actually held them.


respawn(options?): boolean

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

Respawns this dead player now: their client reloads Overland and stands them at the position. playerDownedEnded follows once they are up.

An Overland position and heading in degrees to stand up at; omitted uses their spawn point (getSpawn, else World.spawn), or the game’s default start when neither is set.

{ x: number; y: number; z: number; }

number

number

number

number

boolean

False when the player is not dead.


revive(options?): boolean

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

Revives this dead player where they lie, with no reload: the game’s own get-up plays and the world around them stays as it is. playerDownedEnded follows once they are up. With auto-respawn on, call it inside a playerDied handler, before the respawn is ordered, or hold the death with setAutoRespawn(false).

health: what they stand up with, clamped to their maximum; omitted or “max” is full health. The game’s own health recovery runs from there unless setHealthRecovery(false).

number | "max"

boolean

False when the player is not dead, or a respawn or revive is already on its way.


sendChat(message): void

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

Sends a chat line to this player.

string

Chat line to send to this player.

void


sendUI(name, event, payloadJson): void

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

Sends a message to this player’s name view (fires a DOM CustomEvent).

string

The view handle opened via showUI.

string

DOM CustomEvent name fired on the page.

string

JSON text used as the event detail.

void


setAnimalForm(form): void

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

Turns this player into an animal on every client, their own included: the human is hidden and an inert copy of the animal walks at its feet, taking its walk, trot and gallop from the player’s speed; an enemy creature’s copy is its pawn without its AI, which neither fights nor counts as an enemy; a species that flies in the game takes its flight poses whenever the player is well off the ground. Their own client holds their spells off while it lasts. The player’s capsule, camera and hitbox are fitted to the animal (full scale, held to setScale’s range, which also holds the size); setScale meanwhile sets the human’s size, which comes back with null. Throws a RangeError for a species outside Player.animalForms(), for the cat look on anything but a Kneazle, for a color the form does not have, for a gender other than “male” or “female”, and for a size of 0 or less.

{ color?: string; gender?: "male" | "female"; look?: "species" | "cat"; size?: number; species: AnimalFormSpecies; } | null

The animal to wear: a beast, a wild animal or an enemy creature (Player.animalForms() lists them); look: "cat" dresses a Kneazle in the castle cat’s mesh, and size (default 1) is the animal against its natural size. color is one of the species’ Player.animalForms() colors, or for the cat look “Default” (grey) or “Variation1”-“Variation9” (black, calico, orange, Siamese, Somali, spotted, striped, tortoiseshell, Turkish Van). Omitted, color and gender keep what the player wears now when the species and look stay; otherwise the color is rolled on the game’s spawn weights and the gender is the player’s own. null turns them back.

void


setAutoRespawn(on): void

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

Chooses whether this player respawns on their own a few seconds after dying. While off, a dead player stays down, keeps seeing the world, and does not regenerate until player.respawn. Set it inside a playerDied handler to decide for that death; switching it on while they are held respawns them.

boolean | null

false holds this player where they fell after dying; null restores server.json’s mod.autoRespawn.

void


setBroomSpeedMultiplier(multiplier): void

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

Scales this player’s broom cruise, boost and turbo speeds on top of their upgrade tier, so tier 3 at 1.5 flies half again as fast as a fully upgraded broom. Their client applies it at once, mounted or not, and holds it over respawns and travel; scripted flight such as races keeps its own speeds. Values above 3 are refused: much faster outruns the world streaming in.

number | null

0.25 to 3; 1 is the tier’s own speed. null restores server.json’s mod.broomSpeedMultiplier.

void


setBroomUpgradeTier(tier): void

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

Gives this player the game’s broom upgrades from Albie Weekes’ shop: each tier raises flying and boost speed and lets the boost meter refill higher above the ground. Their client applies it at once, mounted or not, and holds it over respawns and travel.

number | null

0 (no upgrades) to 3 (all three); null restores server.json’s mod.broomUpgradeTier.

void


setCollidable(collidable): void

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

Takes this player out of player collision (World.setPlayerCollision) or puts them back, on every client, their own included. Server-owned, so their client cannot undo it. NPCs and the world are unaffected.

boolean

false lets this player pass through everyone, and everyone through them.

void


setCosmetic(slot, cosmetic): void

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

Shows a piece of gear or a few meshes on this player on top of what they wear, on every client, their own included, in their AvatarPreview figure and in the character creator; players who arrive later see it too, and it stays through respawns, travel, area changes and changes of look or gear. It is only drawn: their inventory, gear, stats and the game’s menus are untouched. The game fits and animates gear as it does worn gear, in the gear’s own colours (its house colours for gear that has them); any GearID of the game’s gear data works, whatever slot it belongs to, and one the game does not know shows nothing. Each gear piece takes one of the few free places a body has, in the order the slots were filled, so on a crowded body the last ones may not show. A slot named in a worn cosmetic’s hides shows nothing until that cosmetic comes off, and two that hide each other both show nothing. Not drawn on the player while a setTransmog disguise is worn (their AvatarPreview figure, which never shows the disguise, keeps it); hidden with the player by setVisible. At most 8 slots hold something at once. Dropped when they disconnect. Throws a TypeError for a slot that is not a string, for anything but { gear }, { meshes } or null, for a mesh that is not an object with a string path and for hides that is not an array; a RangeError for a slot name that is not 1-32 letters, digits and underscores starting with a letter or is a gear slot’s name, for a GearID that is empty, over 96 characters or holds a quote or control character, for meshes that hold none or more than 4, for a mesh path that is not an asset path or a socket that is empty or over 64 characters, for a hides entry that is no slot name or names this slot, for more than 8 hides, for a ninth slot and for cosmetics too large to send; an Error for malformed materials and when the player is not connected.

string

The cosmetic slot: 1-32 letters, digits and underscores starting with a letter, e.g. “Ears”, matched without regard to case. Any name but a gear slot’s (Head, Face, Neck, Hand, Back, Outfit). A slot needs no definition: it exists while something is in it.

CosmeticOptions | null

{ gear } wears the look of that gear item in this slot, by its GearID. { meshes } attaches 1-4 meshes to the body the way equipProp holds a prop, each on its socket, “head” (the body’s head bone) when omitted. hides names other cosmetic slots that show nothing while this one is worn. null empties the slot.

void


setCrouching(on): void

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

Crouches this player through the game’s own crouch (the one its crawl spaces use) or releases it; they keep moving, at the crouched walk, and every other player sees it. Held across respawns and map loads until released or they disconnect. Their client refuses to crouch while swimming or mounted and crouches once it can; a crawl space the player is in keeps them down after a release. isCrouching follows once it has applied.

boolean

true crouches the player, false lets them stand.

void


setDamageGivenMultiplier(multiplier): void

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

Scales the damage this player deals: to NPCs on their own client, and to other players where the server prices PvP (before Pvp.setPolicy, like damageScale; the killing curse stays lethal). It multiplies with the target’s setDamageTakenMultiplier and stacks on the game’s own gear, potion and difficulty modifiers. Held over respawns and travel.

number | null

1 is native, 0 deals none; null restores 1.

void


setDamageTakenMultiplier(multiplier): void

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

Scales the damage this player takes from NPCs and from other players, the same way setDamageGivenMultiplier scales what the attacker deals. Falls, drowning and other damage with no attacker are untouched.

number | null

1 is native, 0 takes none; null restores 1.

void


setFacialEmotion(emotion): void

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

Holds a facial expression on this player on every client, their own included, until it is changed or cleared; players who arrive later see it too. It is the game’s own facial emotion, held above the ones its abilities and scenes ask for, so the body keeps moving and casting under it. Other players see it plainly; on their own screen their own face shows it only faintly, if at all. Dropped when they disconnect. Throws a RangeError for a name outside Player.facialEmotions() and a TypeError for anything but a name or null.

FacialEmotion | null

One of Player.facialEmotions(), or null to hand the face back to the game.

void


setFastTravelEnabled(on): void

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

Allows or stops this player’s own fast travel from the map, for this connection. Off, their game dims every Floo flame and refuses a pick without asking the server; story travel and player.fastTravel still go. On by default.

boolean

false stops this player fast travelling from their map.

void


setFastTravelUnlocked(ids, unlocked?): number

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

Lights Floo flames on this player’s map, for this connection, the way finding them in their own game does, so they can fast travel there; false dims them. Their game applies it once their world has loaded. Raises no playerFastTravelUnlocked. Throws when the player is not connected.

string | string[]

Floo flames by FastTravelLocations id, such as “FT_HW_Boathouse” (case-insensitive).

boolean

false dims them again; default true.

number

How many Floo flames the ids named; any other id is ignored.


setGearStatMultiplier(multiplier): void

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

Scales what this player’s worn gear adds to their Offense, Defense and Cooldown, the stats the game turns into its gear damage bonus and damage reduction. At 0 they fight as if they wore no gear. Their client re-applies the gear at once and holds it over respawns and travel; item tooltips still show each piece’s own roll.

number | null

0 to 1 of each worn piece’s Offense, Defense and Cooldown; 0 makes gear cosmetic. null restores server.json’s mod.gearStatMultiplier.

void


setGearTraits(on): void

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

Allows or strips the traits on this player’s worn gear, such as more Confringo damage or less damage taken from trolls. Their client re-applies the gear at once and holds it over respawns and travel; item tooltips still list the traits.

boolean | null

false strips the traits of this player’s worn gear. null restores server.json’s mod.gearTraits.

void


setHealth(amount): void

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

Sets this player’s health on their own client, which the game then reports back as usual.

number | "max"

New health, or “max” to restore it; the game clamps it to the player’s maximum.

void


setHealthRecovery(on): void

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

Allows or stops this player’s natural health recovery, e.g. for the length of a duel or for good on a roleplay server. Their client holds it over respawns and map loads until it is changed, and a death keeps it off until they are back up either way.

boolean

false stops this player’s health from recovering on its own.

void


setInvulnerable(on): void

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

Holds or releases this player’s damage immunity. Their client keeps re-applying it while held, even over its own scripts and after a respawn; the server also drops PvP and NPC hits on them. Releasing leaves the flag to client scripts again.

boolean

true to hold this player immune to damage.

void


setKeepHealthOnTravel(on): void

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

Keeps this player’s health across map loads such as entering or leaving a dungeon, instead of the full health a fresh body starts with. A respawn after a death still starts full; set its health in playerDownedEnded. Off by default.

boolean

true carries this player’s health over a map load.

void


setLook(look, callback?): number

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

Applies a look, sanitizes it and broadcasts it; clears any transmog. A malformed field (a gear id without GA_, an unknown category, a newer version) fails with INVALID_APPEARANCE naming it before anything reaches the client; an id the game does not know is dropped by the game, so read getLook back. Its gear and hood reach other players’ view of this player only: the player’s own worn items keep their inventory state, so restore those with player.inventory.

string | LookJson

A look from getLook, Creator.exportLook or playerAppearanceChanged, or its JSON text.

AppearanceCallback

Called after the owning client’s native appearance reload settles.

number

The native acknowledgement request id, or 0 when no callback was supplied.


setMapDiscovery(discovery): void

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

Sets how much of the world map this player has uncovered, for this connection. Their game applies it once their world has loaded, and they keep exploring from there. Raises no playerMapDiscoveryChanged. Throws on any other value, and when the player is not connected.

string | boolean

true lifts all fog, false fogs everything, a getMapDiscovery() value restores it.

void


setMaxHealth(maxHealth): void

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

Holds this player’s max health at a server-chosen value. Their client re-applies it over level-ups, gear, respawns and travel; current health is clamped to it, setHealth(“max”) fills to it, and Pvp.getVitals and the PvP policy report it.

number | null

New max health; 0 or null restores the native, level-driven value.

void


setNametagColor(color): void

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

Tints the text on this player’s nametag.

number

Packed 0xAARRGGBB color.

void

BasePlayer.setNametagColor


setNametagHealthVisible(visible): void

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

Shows or hides the health bar under this player’s nametag, leaving the name itself alone.

boolean

True to show the health bar under this player’s name, false to hide it.

void

BasePlayer.setNametagHealthVisible


setNametagText(text?): void

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

Overrides the text drawn on this player’s nametag.

string

Text to show instead of the player’s name, cut to 64 bytes; empty or omitted restores the name.

void

BasePlayer.setNametagText


setNametagVisible(visible): void

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

Shows or hides the name over this player’s head for every other player. The health bar has its own switch, and each player can still hide all nametags locally.

boolean

True to show this player’s nametag to everyone, false to hide it.

void

BasePlayer.setNametagVisible


setPerch(perch): void

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

Puts an animal on this player’s shoulder on every client, their own included: an inert copy of the game’s own creature, attached to the body, that rides along through walking, casting and flight. size is against the animal’s natural size and defaults to one that fits a shoulder, no taller than 30 cm and no longer than 34 (Player.perches() gives each species’ height, reach and default); it is held so the animal stands between 4 and 90 cm and reaches no further than 120. shoulder is “left” (default) or “right”, pose “stand” (default), “sit”, “lie” or “sleep”. offset moves and turns it against the shoulder point, for a body or a size the default spot does not suit: x, y, z in cm on a body of natural size (ahead, away from the neck, up; each held within 100), then pitch, yaw, roll in degrees (nose up, turned and leaned away from the neck) about its feet. It is mirrored by the shoulder, so one offset reads the same on either, and is none when left out. An omitted color is rolled on the game’s own weights, and color and gender carry over a change of size, shoulder or pose. Server-owned and dropped when they disconnect; hidden with the player by setVisible. Throws a RangeError for an unknown species, color, shoulder or pose.

PerchOptions | null

The animal to carry: a beast or a wild animal (Player.perches() lists them), or null to put it down.

void


setPvpFlag(on): object

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

Flags this player for PvP, or unflags them. An unflag within rules.flagCombatLockSeconds of their last PvP hit waits that out: the answer says how long, and pvpFlagChanged fires when it lands. Every client sees the flag.

boolean

true opts this player into PvP under rules.who “flagged”.

object

Whether they are flagged now, and pendingMs while an unflag waits.

flagged: boolean

optional pendingMs?: number


setPvpTeam(team): void

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

Puts this player on a PvP team. Teammates never hurt each other unless rules.friendlyFire is on, and under rules.who “teams” only players on different teams fight. Every client sees the team.

string | null

Any name of up to 32 bytes; null or “” leaves every team.

void


setRagdoll(on): void

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

Drops this player into the game’s ragdoll where they stand and keeps them down, or lets them back up, within a few seconds; they cannot move or cast meanwhile. Other players see the body collapse and lie still, not the physics. Their client refuses it without a body, dead or mounted, and drops the hold when they die, respawn or change map. isRagdoll follows once it has applied.

boolean

true drops the player limp, false lets them get up.

void


setScale(scale, mode?): void

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

Resizes this player’s character on every client, their own included. A broom they ride is resized with them in either mode; its flight collision keeps native size. Full mode honours any size: a large capsule will not fit through doors. In an animal form this is the human’s size, worn again once the form ends.

number

Uniform body scale; 1 is native, clamped to 0.1-10.

"full" | "visual"

“full” (default) also resizes collision, the hitbox and the lock-on point; “visual” resizes only the body and worn gear.

void


setSkinFx(name): void

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

Holds one of the game’s skin effects (the material effects it draws over a body: stone skin, the potion glows, outlines) on this player on every client, their own included, until it is changed or cleared; players who arrive later see it too. One effect is held at a time, and a body shows one skin effect at a time: the game’s own effects can cover the held one, which comes back when they end. An effect that ends on its own is started again. A name the game’s library does not have holds nothing visible. Dropped when they disconnect. Throws a RangeError for a name that is not 1-48 letters and digits and a TypeError for anything but a name or null.

string | null

A skin effect’s name in the game’s SkinFX library, e.g. “StoneSkin”, or null to end the held one.

void


setSpawn(spawn): void

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

Sets where this player’s world loads stand them, ahead of World.setSpawn. Set inside a playerConnected handler, it places the load that brings them into the world, so they never pass through the dormitory; after that it applies to their respawns without a position. It is held for this connection only. A handler that awaits before calling it misses the connect load: fetch saved positions in playerConnecting instead.

{ position: { x: number; y: number; z: number; }; yaw?: number; } | null

An Overland position and a heading in degrees (default 0); null falls back to World.spawn.

void


setTransmog(characterId): void

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

Disguises this player as a registered game character (session-only).

string

A CharacterDefinition id (e.g. ‘EleazarFig’); “” reverts.

void


setVirtualWorld(world): void

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

Moves this player into another virtual world within the map they are in.

number

Virtual-world identifier used to partition replication and visibility.

void

BasePlayer.setVirtualWorld


setVisible(visible): void

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

Hides or shows this player on every other client: body, wand, held prop, the broom or creature they ride, nametag, minimap blip and collision. Server-owned, so their own client cannot undo it; their own view is unchanged. Newcomers see it too. setVisibleFor overrides it for one viewer.

boolean

false hides this player from everyone else.

void


setVisibleFor(viewer, visible): void

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

Overrides setVisible for one viewer, so a player can be hidden from some players only, or seen only by some. Hides what setVisible hides, and the two pass through each other while either cannot see the other. Server-owned; an override goes when either player leaves. Throws a RangeError past 1024 viewers on one player.

Player

The player whose view this changes; not this player.

boolean | null

false hides this player from viewer, true shows this player to viewer while setVisible(false) hides them from everyone else, null goes back to setVisible.

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

BasePlayer.setVisibleTo


setWandGlow(color): void

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

Tints the glow this player’s wand shows when they cast, on every client, their own included, until it is changed or cleared; players who arrive later see it too. The tint is a hue: each spell keeps its own brightness, so { r: 1, g: 0, b: 0 } is that spell’s glow in red and black puts the glow out. Only the wand’s glow changes: a spell’s bolt, trail and impact keep the colors the game drew them in. Dropped when they disconnect. Throws a TypeError for anything but a color or null.

{ b: number; g: number; r: number; } | null

The tint, each channel 0-1, or null for each spell’s own color.

void


showUI(name, url): void

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

Opens a CEF web view on this player’s client (requires the ui resource).

string

Caller-chosen stable handle for the view.

string

Page the client should open.

void


startActivity(id, variant?): void

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

Starts an activity on this player the way LocalPlayer.startActivity does on their own client, replacing one under way; every other player sees it. Their client refuses it without a body, dead or mounted, and getActivity follows once it has started; a Howler ends the activity itself once it has had its say, and Pepper-Up once it is drunk. Throws a RangeError for an unknown id or variant.

ActivityId

Which activity.

ActivityVariant

One of the activity’s variants; omit for its default, which their client picks: the kite their house’s, the rain cloud snow in winter, the Howler’s voice at random.

void


stopAnimalAttack(): boolean

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

Ends the attack under way on every client, its body going back to walking; playerAnimalAttack reports it interrupted.

boolean

False when no attack was under way.


stopClip(): void

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

Ends whatever clip this player plays, on every client, the way LocalPlayer.stopEmote does on their own.

void


stopMoving(owner?): boolean

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

Ends the drive with “released”; the player stops where they are.

string

Only this owner’s drive; omit for whichever runs.

boolean

False when no drive (of that owner) ran.


teleport(x, y?, z?, options?): number

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

Queues a same-area streamed teleport on this player’s client.

number | Vector3Like

number

number

TeleportOptions

Optional yaw and native downward ground-snap settings.

number

Request id reported by playerTeleportCompleted.


teleportAsync(x, y?, z?, options?): Promise<TeleportCompletion>

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

teleport, awaited: resolves with the completion playerTeleportCompleted also carries (check its status), and rejects when the player disconnects first.

number | Vector3Like

X, or the whole destination.

number

number

TeleportOptions

Optional yaw and native downward ground-snap settings.

Promise<TeleportCompletion>

The completion.


toString(): string

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

Returns a readable representation of this handle.

string

BasePlayer.toString


travelToMap(map, options?): number

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

Loads another map on this player’s client, a mod’s included, through the game’s own level travel. The client first checks the map and every level are installed (declined otherwise), and loading the map they are in reloads it. Players only meet others in the same map, so this also moves them out of everyone else’s view.

string

The map’s package path: “/Game/Levels/Overland/Overland”, a dungeon such as “/Game/Environment/Azkaban/Maps/Azkaban_Dungeon”, or a mod’s “//Maps/”. Its last segment is the areaId the player reports there.

MapTravelOptions

Where to stand the player and which extra levels to load; omitted, the map’s own default start (on Overland, their spawn point when one is set) and nothing more.

number

Request id reported by playerMapTravelCompleted.


travelToMapAsync(map, options?): Promise<MapTravelCompletion>

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

travelToMap, awaited: resolves with the completion playerMapTravelCompleted also carries (check its status), and rejects when the player disconnects first.

string

The map’s package path, as travelToMap takes it.

MapTravelOptions

As travelToMap takes them.

Promise<MapTravelCompletion>

The completion.


travelToPlace(name): number

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

Takes this player to a place no single map makes, such as Gringotts from the intro: a travelToMap to the place’s map and spawn with the levels the game loads with it. Players there only see others who went to the same map.

"intro.gringotts" | "intro.vault" | "intro.cliffside"

A place the game builds from several maps (case-insensitive).

number

Request id reported by playerMapTravelCompleted, or 0 when the name is no place.


travelToPlaceAsync(name): Promise<MapTravelCompletion>

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

travelToPlace, awaited: resolves with the completion playerMapTravelCompleted also carries. Rejects for an unknown place, and when the player disconnects first.

"intro.gringotts" | "intro.vault" | "intro.cliffside"

A place travelToPlace knows.

Promise<MapTravelCompletion>

The completion.


static animalForms(): AnimalFormInfo[]

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

Every species setAnimalForm accepts: the beasts of Beast.catalog(), then the game’s wild and farm animals (kind “wildlife”), then its enemy creatures by EnemyDefinition id (kind “enemy”: spiders, trolls, wolves, the Inferius and Dugbogs, each in its single “Default” color), each with its colors and their spawn weights, whether it takes flight poses in the air, and the attacks playAnimalAttack plays on it (none but an enemy’s).

AnimalFormInfo[]


static facialEmotions(): FacialEmotion[]

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

Every expression setFacialEmotion accepts: the game’s facial emotions that play a facial animation.

FacialEmotion[]


static perches(): PerchSpeciesInfo[]

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

Every species setPerch accepts: the beasts of Beast.catalog(), then the game’s wild and farm animals, each with its natural height and reach (nose to tail, or wingtip to wingtip) in cm, the size setPerch gives it by default, and its colors.

PerchSpeciesInfo[]

readonly accountId: string

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

The account this player proved when they connected: 32 hex characters, the same on every server and in every session, that no other client can claim. Key saved data, ownership, bans and permissions on it. It stands for a key the player’s client keeps on their computer, so a player who loses that file starts a new account. Empty once the player has left.

BasePlayer.accountId


readonly appearanceRevision: number

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

Monotonic revision of this connection’s authoritative appearance publications.


readonly broomSpeedMultiplier: number

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

The broom speed multiplier this player flies with, 0.25-3 (see setBroomSpeedMultiplier).


readonly broomUpgradeTier: number

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

The broom upgrade tier this player flies with, 0-3 (see setBroomUpgradeTier).


readonly clip: { hold: boolean; loop: boolean; path: string; rate: number; } | null

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

The clip this player plays, as their client last reported it, or null: one playClip set here or their own client started.


commonRooms: ("Gryffindor" | "Hufflepuff" | "Ravenclaw" | "Slytherin")[]

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

Common rooms this player may enter besides their own house’s, e.g. for staff: those entrances open for them as they would for a member of that house. Their house is unchanged. Assign [] to take the access away.


readonly connected: boolean

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

Whether this handle still resolves to a connected player.


readonly damageGivenMultiplier: number

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

The multiplier set by setDamageGivenMultiplier; 1 when native.


readonly damageTakenMultiplier: number

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

The multiplier set by setDamageTakenMultiplier; 1 when native.


readonly discordId: string

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

Discord identifier, or an empty string when unavailable. Reported by the player’s client and not verified: a modified client can send anyone’s. Show it or log it; never key ownership, bans or permissions on it, which is what accountId is for. Discord ids are public.

BasePlayer.discordId


readonly discordName: string

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

Discord username, or an empty string when unavailable. Reported by the player’s client and not verified: a modified client can send anyone’s. Show it or log it; never key ownership, bans or permissions on it, which is what accountId is for.

BasePlayer.discordName


dormitories: ("witch" | "wizard")[]

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

Dormitory staircases this player may climb besides their own pronoun’s, e.g. for staff: “witch” keeps the girls’ staircases from turning into a slide under them, on every client. The game never closes the boys’ staircases, so “wizard” changes nothing. Their gender is unchanged. Assign [] to take the access away.


readonly effects: PlayerEffects

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

Timed potion effects. apply/clear command the owning client (the ability lives there); has/list read the server-owned mask.


readonly epicId: string

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

Epic Games account identifier, or an empty string when unavailable. Reported by the player’s client and not verified: a modified client can send anyone’s. Show it or log it; never key ownership, bans or permissions on it, which is what accountId is for.

BasePlayer.epicId


readonly gear: PlayerGear

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

Per-slot gear controller: what the player wears on each body slot and what they can wear there. Reads come from the client’s last report and are synchronous; equip, unequip and apply are client round trips whose callback fires once the worn set agrees, carrying the appliedRevision it settled at. Prefer apply for a multi-slot change: it costs one round trip and one client tick instead of one per slot. Slots and item-to-slot mapping come from the game’s own tables, so gear added by a UGC mod behaves like shipped gear.


readonly gearStatMultiplier: number

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

How much of their worn gear’s stats this player gets, 0-1 (see setGearStatMultiplier).


readonly gearTraits: boolean

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

Whether this player’s worn gear traits apply (see setGearTraits).


gender: "male" | "female"

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

Wizard (“male”) or Witch (“female”): the pronoun the game’s dormitory staircases check. Follows the worn look’s pronoun; assignment sets it on the owning client without rebuilding the appearance, and the next published look carries it.


readonly hardwareId: string

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

Framework hardware identifier, or an empty string when unavailable. Reported by the player’s client and not verified: a modified client can send anyone’s. Show it or log it; never key ownership, bans or permissions on it, which is what accountId is for.

BasePlayer.hardwareId


house: "Gryffindor" | "Hufflepuff" | "Ravenclaw" | "Slytherin" | "Unaffiliated"

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

Server-owned Hogwarts house; assignment applies it on the owning client.


readonly id: number

Defined in: shared.d.ts:65

Network id, stable for the entity’s lifetime.

BasePlayer.id


readonly inventory: PlayerInventory

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

Server-authoritative inventory controller. Its reads never consult client memory, and the model belongs to the connection: a joining player starts empty and everything here is dropped on disconnect.


readonly ip: string

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

Current remote network address, or an empty string when unavailable.

BasePlayer.ip


readonly maxHealth: number

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

The max health set by setMaxHealth, else the max their client last reported; 0 before the first report.


readonly nickname: string

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

The player’s current nickname.


readonly ping: number

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

Current round-trip latency in milliseconds, or -1 when unavailable.

BasePlayer.ping


position: Vector3

Defined in: shared.d.ts:67

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

BasePlayer.position


rotation: Vector3 | Quaternion

Defined in: shared.d.ts:69

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

BasePlayer.rotation


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.

BasePlayer.state


readonly steamId: string

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

Steam identifier, or an empty string when unavailable. Reported by the player’s client and not verified: a modified client can send anyone’s. Show it or log it; never key ownership, bans or permissions on it, which is what accountId is for.

BasePlayer.steamId


readonly virtualWorld: number

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

The virtual world scripts put this player in. Replication combines it with the game map the player is in, so players in different maps never meet.

BasePlayer.virtualWorld


readonly wand: PlayerWand

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

The player’s wand: whether it is drawn, which wand it is, and the styles the game offers. Reads come from the client’s last report and are synchronous; equip, unequip and setStyle are client round trips with a callback. The game’s own behaviour tree also draws and stows the wand, so equip/unequip are requests, not latches - a callback can come back WAND_REVERTED.