Skip to content
KCKingdoms Connected Scripting APIScripting guides and API
Global objectServer APIGenerated

Chat

const Chat: object

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

Server-side delivery of structured chat messages to connected clients.

isDefaultRelay(): boolean

Checks whether the built-in chat relay is enabled.

boolean

True when chat is relayed automatically.

sendToAll(text, options?): void

Broadcasts a structured chat message to all clients.

string

Message body broadcast to every connected client.

Optional author label and color: a Color or a packed 0xRRGGBBAA integer.

string

number | Color

void

sendToPlayer(player, text, options?): void

Sends a structured chat message to one player’s owning connection.

Entity

Player-owned entity identifying the destination connection.

string

Message body sent to the player.

Optional author label and color: a Color or a packed 0xRRGGBBAA integer.

string

number | Color

void

setDefaultRelay(enabled): void

Enables or disables the built-in player-to-player chat relay.

boolean

True to relay chat automatically; false to answer playerChat yourself.

void