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.
Methods
Section titled “Methods”
staticall():WorldResource[]
Defined in: server/api.d.ts:7504
Lists config-loaded world exports in configuration order. Empty before successful startup and after shutdown.
Returns
Section titled “Returns”WorldResource[]
A fresh array of resource handles.
find()
Section titled “find()”
staticfind(name):WorldResource|null
Defined in: server/api.d.ts:7511
Finds a config-loaded export by name. Throws for a non-string argument.
Parameters
Section titled “Parameters”string
Exact, case-sensitive resource name.
Returns
Section titled “Returns”WorldResource | null
The resource, or null when absent or startup has not completed.
Properties
Section titled “Properties”
readonlyareas:Area[]
Defined in: server/api.d.ts:7488
A fresh array of surviving exported areas in export order, excluding destroyed areas.
readonlydoors: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.
effects
Section titled “effects”
readonlyeffects:Vfx[]
Defined in: server/api.d.ts:7463
A fresh array of surviving effects in export order, excluding destroyed effects.
readonlyitems: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.
readonlylevel:string
Defined in: server/api.d.ts:7443
The exported game level, checked against the server level at startup. Empty after shutdown.
levelEdits
Section titled “levelEdits”
readonlylevelEdits:LevelEdit[]
Defined in: server/api.d.ts:7468
A fresh array of surviving level edits in export order, excluding restored edits.
lights
Section titled “lights”
readonlylights:Light[]
Defined in: server/api.d.ts:7458
A fresh array of surviving point lights in export order, excluding destroyed lights.
loaded
Section titled “loaded”
readonlyloaded:boolean
Defined in: server/api.d.ts:7448
Whether this export is registered. Remains true even if scripts destroy all of its contents.
readonlyname: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.
readonlypath:string
Defined in: server/api.d.ts:7438
Resolved absolute source file path, in UTF-8. Empty after shutdown.
patrolRoutes
Section titled “patrolRoutes”
readonlypatrolRoutes:PatrolRoute[]
Defined in: server/api.d.ts:7493
Surviving exported patrol definitions, in export order.
readonlyprops: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.
smartObjects
Section titled “smartObjects”
readonlysmartObjects: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.
readonlystaticready: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.