Skip to content
M2O Scripting APIScripting reference
Data shapeClient APIGenerated

BasePlayer

Defined in: client/api.d.ts:3997

Framework-owned base handle for a connected player, extended by each game or mod.

getNametagColor(): number

Defined in: client/api.d.ts:4026

Reads this player’s nametag color.

number

Packed 0xAARRGGBB color; opaque white when untinted.


getNametagText(): string

Defined in: client/api.d.ts:4020

Reads this player’s nametag text override.

string

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


isNametagHealthVisible(): boolean

Defined in: client/api.d.ts:4014

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.


isNametagVisible(): boolean

Defined in: client/api.d.ts:4008

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.


toString(): string

Defined in: client/api.d.ts:4002

Formats this player handle for logging and debugging.

string

Text containing the player’s network entity ID.

Entity.toString

readonly id: number

Defined in: client/api.d.ts:3926

Immutable network entity identifier.

Entity.id


position: Vector3

Defined in: client/api.d.ts:3936

Authoritative world-space position; assignment forces replicated state.

Entity.position


rotation: Vector3 | Quaternion

Defined in: client/api.d.ts:3941

Authoritative rotation; reads return a quaternion and assignments accept a quaternion or Euler angles in degrees.

BasePlayer.rotation


readonly state: StateBag

Defined in: client/api.d.ts:3946

Arbitrary key/value state carried by this entity. The server writes it and every client that can see the entity receives it; see StateBag.

Entity.state


readonly virtualWorld: number

Defined in: client/api.d.ts:3931

Current virtual-world identifier.

Entity.virtualWorld