Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

ConsumableProduct

A product bought again and again, such as a potion. The game gives the player what it bought each time, in grant, and keeps it in the save.

  • DeclaredFields
Type Parameter Default type
Schema extends ProductContextSchema | undefined undefined
Property Type Description
context? Schema What a purchase is for, such as a plot or a season: buy passes a value of it, which the receipt freezes and grant receives.
grant (context) => void | GrantResult Gives the player what they bought, once a purchase. It runs inside transact, so a decline or a throw applies nothing it changed and gives the Spawnites back.
icon string The picture the purchase sheet shows, by its path under the game’s public/ folder, such as icons/sword.png.
kind "consumable" Bought again and again, and granted each time.
name string What the purchase sheet calls it: at most 50 characters.
perPlayerLimit? number How many one player buys, from 1; left out, no limit.
price number Whole Spawnites, from 10 to 10,000, 100 to the dollar.
retired? boolean No longer for sale; its owners keep it.
stock? number How many the game sells across all its rooms and worlds, from 1; left out, no limit.