Skip to content

API Interface WorldHandle

github-actions[bot] edited this page Nov 24, 2026 · 4 revisions

Interface: WorldHandle

Defined in: src/engine/core/worlds.ts:129

A handle on a World: the only cross-World API. It controls the World's lifetime and setup but never exposes its nodes, so Worlds stay isolated (ADR 0032).

Properties

alive

readonly alive: boolean;

Defined in: src/engine/core/worlds.ts:133

False once destroyed. Methods on a destroyed handle throw.


name

readonly name: string;

Defined in: src/engine/core/worlds.ts:130


paused

readonly paused: boolean;

Defined in: src/engine/core/worlds.ts:134


tags

readonly tags: readonly WorldTag[];

Defined in: src/engine/core/worlds.ts:131

Methods

addresses()

addresses(): readonly string[];

Defined in: src/engine/core/worlds.ts:155

Where this World listens (ADR 0067). Empty if it doesn't.

Returns

readonly string[]


addSystem()

addSystem(name): void;

Defined in: src/engine/core/worlds.ts:139

Add a catalog system by name. Throws for unknown names.

Parameters

name

string

Returns

void


connect()

connect(
   server, 
   transport, 
   options?
): void;

Defined in: src/engine/core/worlds.ts:147

Join this World (client side) to server over a transport (ADR 0033): a World of this page, or the address of a server elsewhere, such as a dedicated server's "ws://host:7777" (ADR 0036).

Parameters

server

string | WorldHandle

transport

string

options?

Record<string, unknown>

Returns

void


destroy()

destroy(): void;

Defined in: src/engine/core/worlds.ts:159

Destroy the World and everything in it.

Returns

void


hasTag()

hasTag(tag): boolean;

Defined in: src/engine/core/worlds.ts:135

Parameters

tag

WorldTag

Returns

boolean


listen()

listen(transport, options?): Promise<string>;

Defined in: src/engine/core/worlds.ts:153

Make this World a server and listen over a transport (ADR 0067). Resolves with the address clients connect to; rejects with a reason. Options: port, host, path, address, maxConnections and timeouts. Throws if the World is a client.

Parameters

transport

string

options?

Record<string, unknown>

Returns

Promise<string>


loadScene()

loadScene(path, options?): Promise<void>;

Defined in: src/engine/core/worlds.ts:137

Load a scene into the World (at the end of its next frame if it's mid-frame).

Parameters

path

string

options?
additive?

boolean

Returns

Promise<void>


pause()

pause(): void;

Defined in: src/engine/core/worlds.ts:156

Returns

void


removeSystem()

removeSystem(name): void;

Defined in: src/engine/core/worlds.ts:140

Parameters

name

string

Returns

void


resume()

resume(): void;

Defined in: src/engine/core/worlds.ts:157

Returns

void


systems()

systems(): readonly string[];

Defined in: src/engine/core/worlds.ts:142

The World's systems by name, in execution order per phase.

Returns

readonly string[]

Clone this wiki locally