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

BuildingOptions

What building() takes.

  • BuildingHooks
Property Type Default value Description
bounds? CellBounds ±1,024 cells, ±64 levels The cells a piece may fill.
cellSize? number 1 Metres a cell is across x and z.
checkAccess? (context) => boolean | BuildRefusalResult undefined Who may take each action where; readBuildAccess when left out. False refuses not-allowed; a refusal names its own reason and line, such as “Your side is the left”.
checkPlace? (context) => BuildRefusalResult | null undefined The game’s rule for a placement or a move: a pure read run on the player’s page for the ghost and on the room before anything is written.
keys? BuildingKeys R, none and X The keys the build tool’s rotate, place and cancel take, each a page action in the game’s key table, so a key another binding holds is refused as the world is made.
levelHeight? number cellSize Metres a level is tall.
maxPieces? number 20,000 The most pieces, placed and stored, the world holds: past it, world-full. Under the 28,000 small records a 256 MB room holds.
maxPiecesPerPlayer? number none The most pieces, placed and stored, one player places in a world: past it, player-full, so one player cannot fill a shared world, as Rust’s upkeep keeps a base in check.
onPiecePlace? (context) => BuildRefusalResult | null | undefined undefined The payment, on the room, inside the placement’s transaction, before the piece spawns or moves: a refusal puts back what it wrote.
onPieceRemove? (context) => BuildRefusalResult | null | undefined undefined A refund or a veto before a store or a demolish, on the room, inside its transaction.
origin? readonly [number, number, number] [0, 0, 0] Where cell [0, 0, 0]’s low corner stands.
outside? BuildAreaAccess BuildAreaAccess.Private, the held world’s owner and members, or every player where the room holds no world The world outside every area: who builds there.
pieces readonly PieceHandle[] undefined The palette: every piece a player may place.
reach? number none Metres from the player’s character the player may build at.
storage? PieceStorage none Where a stored piece is kept; left out, a removal demolishes.