Skip to content
KCKingdoms Connected Scripting APIScripting guides and API
Global objectServer APIGenerated

Items

const Items: object

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

Server-defined resource items, drawn with an existing game appearance or with their own model and icon. Register types before restoring their instances.

register(id, definition): string

Registers an immutable miscellaneous type and returns its stable GUID. Identical repeats succeed; conflicts throw. Defaults: empty description, price 0, stackable true, usable false, useLabel Use. visual names a miscellaneous item, crafting material or document whose model, material and icon the type borrows; without it, model and icon are required. model is a path relative to Objects/, as the game’s item tables write it, which the game prefixes with Objects/ itself (a path starting with objects/ throws) and completes with .cgf when it has no extension: a model the resource streams as stream/objects/kcdc//box.cgf is kcdc//box.cgf. It draws the item on the ground, in hand and in the inventory preview, and needs a physics proxy for the item to be picked up from the ground: a model without one shows but cannot be picked up. material is a material path in the same form, allowed only with model; without it the model’s own material is used. icon is a base64 PNG of at most 256 KiB and 4096x4096 pixels; it is scaled to the stock 64x64 icon size, aspect kept.

string

string

string

string

string

string

number

boolean

boolean

string

string

number

string