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

CraftEndedEvent

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

A batch or workpiece that is over, for any reason. A table kept for the next batch is not closed by this.

kind: "alchemy" | "smithing"

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

Which craft.


outcome: "failed" | "cancelled" | "success"

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

How it ended.


reason: string

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

Empty for a completed batch or a successful workpiece. craftingFailed for a broken workpiece; cancelled for normal native or script cancellation; interrupted for unexpected native teardown; clientError for alchemy adapter errors. Other reasons: craftingCompletingRejected, disconnected, timeout, contextInvalidated, and for smithing abandoned, abandonTooLate, invalidQuality, inventoryUnavailable. See CraftRefundProposal.


refunded: InventoryUnit[]

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

The inventory rows ingredients went back to. Alchemy: wholly unmilled bowl, mortar and herb groups come back; everything else put on the table was spent. Smithing: a failed workpiece spends half of each divisible material, rounded down, and a coin decides a single unit; the rest comes back. A full refund requested through craftingRefunding returns all remaining original materials instead.


session: string

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

The session id.


station: string

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

Station id.


virtualWorld: number

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

The station’s virtual world.