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

CookPot

const CookPot: object

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

Server-owned stew pots. Stocked pots begin with four shared meals, with no automatic refill. State lasts until the server stops.

all(virtualWorld?): CookPotSnapshot[]

Lists every catalogued pot on the server’s level in one virtual world; empty for a world no player or write has used yet.

number

Virtual world id; defaults to 0. The global visibility sentinel is not a stock world.

CookPotSnapshot[]

get(guid, virtualWorld?): CookPotSnapshot | null

Returns a snapshot, or null for an unknown pot.

string

Fireplace level GUID from CookPot.all().

number

Virtual world id; defaults to 0. The global visibility sentinel is not a stock world.

CookPotSnapshot | null

poison(player, guid, rowId): CookPotResult

Poisons a stocked enabled pot with the item’s ingested effect. Refuses a second poison until refill. A meal takes the poison present when reserved, applied once on its eating receipt; NPC poisoning and native crime reactions are not included.

Player

Connected player within four metres; their current virtual world selects the pot.

string

Fireplace level GUID from CookPot.all().

string

Inventory row containing a native Poison item; spends exactly one.

CookPotResult

poisons(): string[]

Item class GUIDs accepted by CookPot.poison, including each native strength variant.

string[]

refill(guid, portions?, virtualWorld?): boolean

Replaces remaining stock and capacity and clears poison, preserving food and enabled. Returns false for an unknown pot.

string

Fireplace level GUID from CookPot.all().

number

Integer from 0 to 1000; defaults to four.

number

Virtual world id; defaults to 0. The global visibility sentinel is not a stock world.

boolean

refillFromInventory(player, guid, recipe): CookPotResult

Spends ingredients atomically and fills an empty enabled pot. Clears old poison. Validates player, distance, ability to act, world and synchronized inventory. Never pass unvalidated client recipe data.

Player

Connected player within four metres; their current virtual world selects the pot.

string

Fireplace level GUID from CookPot.all().

CookPotRecipe

Ingredients and yield chosen by this server script.

CookPotResult

setEnabled(guid, enabled, virtualWorld?): boolean

Allows or blocks eating. Returns false for an unknown pot.

string

Fireplace level GUID from CookPot.all().

boolean

False blocks eating without changing stock or its appearance.

number

Virtual world id; defaults to 0. The global visibility sentinel is not a stock world.

boolean

setFood(guid, food, virtualWorld?): boolean

Changes future meals and appearance, preserving stock, poison and enabled. Already reserved meals keep their previous type.

string

Fireplace level GUID from CookPot.all().

"goulash" | "lentil" | "soup"

Native meal type.

number

Virtual world id; defaults to 0. The global visibility sentinel is not a stock world.

boolean

setState(guid, state, virtualWorld?): boolean

Changes food level and stock together, preserving food, poison and enabled. Returns false for an unknown pot.

string

Fireplace level GUID from CookPot.all().

"full" | "empty" | "half"

Empty, two portions, or four portions; resets capacity to four.

number

Virtual world id; defaults to 0. The global visibility sentinel is not a stock world.

boolean