Dicey Table

ObjectKind vs TableObjectKind

An entity's kind is fixed at spawn and decides which physics defaults the runtime applies, which collision geometry it builds, and which of the optional state fields mean anything. There are nine kinds. There are also two declared unions that name them, and they agree on every concrete value.

Union Where Names
TABLE_OBJECT_KINDS packages/shared/src/tableObjects/kinds/index.ts 9 — the engine's own list, and the authority.
TableObjectKind (mod scripting) DICEYTABLE_MOD_API_DTS 9 — matches the engine exactly.
ObjectKind (table scripting) DICEYTABLE_SCRIPT_API_DTS 9, plus an open (string & {}) escape hatch.

The values#

Value What it is Contexts that accept it Surfaces that name it
card A single card. Its label is its identity, and that identity drives hidden-information redaction. Every spawn path; the only kind a container's contents are made of. Engine · mod TableObjectKind · table-script ObjectKind
deck An ordered stack of cards. Carries stackCount and a contents list; draw, deal, shuffle and split are meaningful. Every spawn path. Engine · mod · table script
die A die. roll throws it with a randomized impulse and lets physics settle it. Every spawn path. Engine · mod · table script
token A general-purpose piece — a marker, a pawn, a counter. Every spawn path. Engine · mod · table script
board A large, usually static surface other pieces sit on. The one kind players cannot flick. Every spawn path. Engine · mod · table script
bag A container that hands out its contents in random, stack or queue order. Every spawn path. Engine · mod · table script
custom Anything driven by a mod's own model. Also the fallback a table script's spawn coerces an unrecognized kind to. Every spawn path. Engine · mod · table script
card-holder A rack that holds cards in view of one seat. Every spawn path, including a table script's. Engine · mod · table script
button A pressable control — a coloured cap in a frame — that raises a press action a script can observe as onPressed. Every spawn path. Engine · mod · table script

Both surfaces name all nine#

The table-scripting ObjectKind union and the mod surface's TableObjectKind both name every kind in the engine's TABLE_OBJECT_KINDS, card-holder and button included. Two kinds were added to the table-script union after it was first written — card-holder alongside the per-kind handle types, and button with the button object — and both had cost only an autocomplete entry beforehand, because the sandbox's own KNOWN_KINDS list always accepted them. So world.getAllObjects({ kind: "card-holder" }) now completes and narrows to CardHolderObject, and world.getAllObjects({ kind: "button" }) narrows to ButtonObject.

The one difference that remains is the table-script union's open (string & {}) arm, which keeps a typo from being a type error — see below.

What an unknown kind does, per surface#

The two surfaces disagree here too, and the difference is worth knowing before you pass a kind that came from data rather than a literal:

  • Table scripting: an unrecognized kind is silently replaced with "custom" in the sandbox. No error, no log line — a typo such as "dice" produces a plain custom entity that never rolls. Read handle.kind back to check.
  • Mod scripting: an unrecognized kind fails the host's schema parse, and the parse failure drops the whole spawn. The entity never appears and the only signal is a mod-console diagnostic.

See also#