Skip to content
KCKingdoms Connected Scripting APIScripting guides and API
Runtime classClient APIGenerated

BasePlayer

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

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

new BasePlayer(id): BasePlayer

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

Creates a wrapper for an existing connected player with this ID; it does not connect or spawn a player.

number

Network entity identifier.

BasePlayer

Entity.constructor

getNametagColor(): number

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

Reads this player’s nametag color.

number

Packed 0xAARRGGBB color; opaque white when untinted.


getNametagText(): string

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

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:5558

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:5552

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:5546

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:5462

Immutable network entity identifier.

Entity.id


position: Vector3

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

Authoritative world-space position; assignment forces replicated state.

Entity.position


rotation: Vector3 | Quaternion

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

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

Entity.rotation


readonly state: StateBag

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

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:5467

Current virtual-world identifier.

Entity.virtualWorld