CookPot
constCookPot: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.
Type Declaration
Section titled “Type Declaration”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.
Parameters
Section titled “Parameters”virtualWorld?
Section titled “virtualWorld?”number
Virtual world id; defaults to 0. The global visibility sentinel is not a stock world.
Returns
Section titled “Returns”get(
guid,virtualWorld?):CookPotSnapshot|null
Returns a snapshot, or null for an unknown pot.
Parameters
Section titled “Parameters”string
Fireplace level GUID from CookPot.all().
virtualWorld?
Section titled “virtualWorld?”number
Virtual world id; defaults to 0. The global visibility sentinel is not a stock world.
Returns
Section titled “Returns”CookPotSnapshot | null
poison()
Section titled “poison()”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.
Parameters
Section titled “Parameters”player
Section titled “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.
Returns
Section titled “Returns”poisons()
Section titled “poisons()”poisons():
string[]
Item class GUIDs accepted by CookPot.poison, including each native strength variant.
Returns
Section titled “Returns”string[]
refill()
Section titled “refill()”refill(
guid,portions?,virtualWorld?):boolean
Replaces remaining stock and capacity and clears poison, preserving food and enabled. Returns false for an unknown pot.
Parameters
Section titled “Parameters”string
Fireplace level GUID from CookPot.all().
portions?
Section titled “portions?”number
Integer from 0 to 1000; defaults to four.
virtualWorld?
Section titled “virtualWorld?”number
Virtual world id; defaults to 0. The global visibility sentinel is not a stock world.
Returns
Section titled “Returns”boolean
refillFromInventory()
Section titled “refillFromInventory()”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.
Parameters
Section titled “Parameters”player
Section titled “player”Connected player within four metres; their current virtual world selects the pot.
string
Fireplace level GUID from CookPot.all().
recipe
Section titled “recipe”Ingredients and yield chosen by this server script.
Returns
Section titled “Returns”setEnabled()
Section titled “setEnabled()”setEnabled(
guid,enabled,virtualWorld?):boolean
Allows or blocks eating. Returns false for an unknown pot.
Parameters
Section titled “Parameters”string
Fireplace level GUID from CookPot.all().
enabled
Section titled “enabled”boolean
False blocks eating without changing stock or its appearance.
virtualWorld?
Section titled “virtualWorld?”number
Virtual world id; defaults to 0. The global visibility sentinel is not a stock world.
Returns
Section titled “Returns”boolean
setFood()
Section titled “setFood()”setFood(
guid,food,virtualWorld?):boolean
Changes future meals and appearance, preserving stock, poison and enabled. Already reserved meals keep their previous type.
Parameters
Section titled “Parameters”string
Fireplace level GUID from CookPot.all().
"goulash" | "lentil" | "soup"
Native meal type.
virtualWorld?
Section titled “virtualWorld?”number
Virtual world id; defaults to 0. The global visibility sentinel is not a stock world.
Returns
Section titled “Returns”boolean
setState()
Section titled “setState()”setState(
guid,state,virtualWorld?):boolean
Changes food level and stock together, preserving food, poison and enabled. Returns false for an unknown pot.
Parameters
Section titled “Parameters”string
Fireplace level GUID from CookPot.all().
"full" | "empty" | "half"
Empty, two portions, or four portions; resets capacity to four.
virtualWorld?
Section titled “virtualWorld?”number
Virtual world id; defaults to 0. The global visibility sentinel is not a stock world.
Returns
Section titled “Returns”boolean