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

WorldResource

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

A named world export loaded from mod.world_resources. Server-owned, with live access to its surviving props, effects, level edits, areas and patrol routes. Obtain handles through all or find; runtime loading, reloading and unloading are not exposed.

static all(): WorldResource[]

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

Lists config-loaded world exports in configuration order. Empty before successful startup and after shutdown.

WorldResource[]

A fresh array of resource handles.


static find(name): WorldResource | null

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

Finds a config-loaded export by name. Throws for a non-string argument.

string

Exact, case-sensitive resource name.

WorldResource | null

The resource, or null when absent or startup has not completed.

readonly areas: Area[]

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

A fresh array of surviving exported areas in export order, excluding destroyed areas.


readonly effects: Vfx[]

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

A fresh array of surviving effects in export order, excluding destroyed effects.


readonly level: string

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

The exported game level, checked against the server level at startup. Empty after shutdown.


readonly levelEdits: LevelEdit[]

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

A fresh array of surviving level edits in export order, excluding restored edits.


readonly loaded: boolean

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

Whether this export is registered. Remains true even if scripts destroy all of its contents.


readonly name: string

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

Unique case-sensitive resource name: the filename without .world.json, or the explicit config name. Empty after shutdown.


readonly path: string

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

Resolved absolute source file path, in UTF-8. Empty after shutdown.


readonly patrolRoutes: PatrolRoute[]

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

Surviving exported patrol definitions, in export order.


readonly props: Prop[]

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

A fresh array of surviving props in export order. Changing the array does not change membership; the handles support normal Prop operations.


readonly static ready: boolean

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

True after every configured export has loaded successfully, even when the config list is empty. Check this before subscribing to worldResourcesReady when a script may start later.