Skip to content
KCKingdoms Connected Scripting APIScripting guides and API
Data shapeServer APIGenerated

DoorDefinition

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

A door to hang where the level has none, as Door.spawn takes it and a World Builder map’s doors array stores it.

optional keyItem?: string

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

The item class GUID of a key that works the keyhole, as player.giveItem takes it. None when omitted.


optional lock?: "none" | "bolt" | "boltAndKey" | "key"

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

What each side takes to get through it while it is locked: none (only a script opens it), bolt (a bolt inside, nothing outside), boltAndKey (a bolt inside, a keyhole outside, as most of the level’s doors) or key (a keyhole on both sides). boltAndKey when omitted.


optional lockDifficulty?: number

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

How hard the lockpicking minigame is, from 0 to 1, read in fifths from very easy to very hard. The game’s own when omitted.


optional locked?: boolean

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

Whether it is hung locked. Unlocked when omitted. A key or a lockpick opens it as the level’s own doors open; the server’s lock (door.locked = true) is a separate thing.


optional lockpickable?: boolean

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

Whether its keyhole can be picked. True when omitted.


model: string

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

The leaf mesh, by path or file stem, from Door.models(): lvl1_door_a_left or objects/characters/assets/doors/lvl1_door_a_left.cdf. Which way it is hinged is part of the mesh.


optional name?: string

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

What a script finds it by, up to 64 bytes of UTF-8; door.name reads it.


position: number[] | Vector3

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

Where the door hangs: the leaf’s pivot, on its hinge side, as the level’s own doors stand. Each coordinate within 16384 of the origin.


optional rotation?: number[] | Quaternion

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

Which way it faces: a Quaternion, {x, y, z, w} or [x, y, z, w]. None when omitted.