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

setSavedEntity

setSavedEntity(authority, player, entity, setSavedEntityOptions?): void

Registers entity as the one player’s save keeps under key, main where none is named: her record for that key restores onto it over what its spawn set up, unless restore is false, and from here it is read at each of her saves and captured as it goes. Registering another under a key replaces the one there, which is captured first, as setViewTarget replaces a view target. A character, a dragon a game spawns in place of one, each character of a party a player switches between, or a pet. Takes the room’s step, requireAuthority, or a join hook’s step for her and what her join spawned. A restore that throws refuses her save’s load and throws a SavedEntityRestoreError, which refuses a join it runs in. Any other refusal throws in development and is logged in a deployed room, which changes nothing.

Parameter Type
authority EntityAuthority
player Entity
entity Entity
setSavedEntityOptions SetSavedEntityOptions

void