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

WorldResource

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

A named world export loaded from mod.world_resources. Server-owned, with live access to its surviving props, effects, level edits, doors, smart objects, items, 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:7504

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

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

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


readonly doors: Door[]

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

A fresh array of the surviving doors the export hangs, in export order, excluding destroyed ones. A door the export takes out of the level is a level edit, in levelEdits; Door.removed lists those.


readonly effects: Vfx[]

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

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


readonly items: GroundItem[]

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

A fresh array of the stacks the export lays on the ground that nobody has picked up yet, in export order. Each one’s name is the name the export gave it.


readonly level: string

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

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


readonly levelEdits: LevelEdit[]

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

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


readonly lights: Light[]

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

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


readonly loaded: boolean

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

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


readonly name: string

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

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

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


readonly patrolRoutes: PatrolRoute[]

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

Surviving exported patrol definitions, in export order.


readonly props: Prop[]

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

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


readonly smartObjects: SmartObject[]

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

A fresh array of the surviving seats, beds, tables and stations the export places, in export order, excluding destroyed ones. A level station the export takes out is a level edit, in levelEdits.


readonly static ready: boolean

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

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.