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

Plugin

What a factory’s call makes: the config, branded, with a typed handle per command, per input and per system.

  • Omit<PluginConfig, "saves" | "commands" | "systems" | "inputs" | "contexts" | "actions" | "requires" | "collisionLayers">
Type Parameter Default type
Systems extends object SystemHandles
Inputs extends InputDeclarations InputDeclarations
Actions extends PageActionDeclarations PageActionDeclarations
Layers extends string string
Commands extends CommandDeclarations CommandDeclarations
Contexts extends InputContextDeclarations InputContextDeclarations
Saves SaveHandles
Property Modifier Type Description
[pluginBrand] readonly true -
[pluginEntries] readonly readonly SystemDefinition<"input" | "rules" | "motion" | "physics", boolean, RunContext, string>[] -
[pluginNamedSaves] readonly SaveDeclarations -
actions readonly PageActionHandles<Actions> One handle per declared page action, siege.actions.ready.
characterView? public CharacterViewComponent The view every character draws with on every page, players’ and NPCs’, where no prefab or trait names one: what characters({ view }) declares. At most one listed plugin declares it. A room imports it and never mounts it.
collisionLayers readonly { readonly [Key in string]: CollisionLayerHandle } One handle per declared collision layer, karts.collisionLayers.ball.
commands readonly CommandHandles<Commands> One typed handle per declared command, siege.commands.pick.
component? public ComponentType<{ }> Its React on a page: default views, and the providers its views’ hooks read. Game nests each plugin’s around the scenes and the HUD in list order, the first outermost. It is a view: a room, and every headless mount, never mounts it, so a scene’s logic reads no context it provides. It always renders its children, which stay logic.
contexts readonly InputContextHandles<Contexts> One handle per declared input context, karts.contexts.driving.
description? public string -
inputs readonly InputHandles<Inputs> One typed handle per declared input, sprint.inputs.sprint.
matchRule? public MatchRule Its answer to the match question the core asks: the match each entity belongs to. At most one listed plugin declares it, as matches() does; a kit that rebuilds matches declares its own.
name public string "abilities", "siege", "frost-nova": the dump lists it, and every system of the plugin is named plugin.system after it.
onCameraUpdate? public CameraUpdateHook Runs while a camera with an orbit is mounted, on frames the loop steps or holds under the devtools pause, after transforms, animation and the event drain, before shake. Modal holds in an alone game, waiting worlds and loading physics run none, as do rooms and headless mounts. Hooks run in dependency then list order. deltaSeconds is the loop’s frame seconds, scaled by devtools speed. A throw names the plugin in development; deployed pages report it once and finish the frame. As Roblox’s RenderPriority.Camera, Unreal’s UpdateCamera and Cinemachine’s camera stages.
onCharacterRespawn? public CharacterRespawnHook What it does as a downed character stands again, on the world that decides outcomes: refill its ammo, reset its buffs. As what a Roblox game puts in CharacterAdded for each life.
onCharacterSpawn? public CharacterSpawnHook What it adds to a character as it appears, from the scene’s CharacterSpawn props: a trait, an ability, a bag. Receives one context: writer, the authority it was spawned under, its character, the player and the props. It runs where it spawns: in the room, on a page played alone and in a headless game, once per spawned entity, so a respawn, which stands the same entity again, runs onCharacterRespawn instead. It runs once it holds its base traits and before the player’s save restores onto it, after the hook of each plugin this one requires. A page in a room runs none: it spawns no character, and the room’s stream brings each with what the room’s hooks added that a page holds. A hook run there again would write its defaults over what the room sent, such as a resource the player has spent.
onControlRelease? public ControlReleaseHook What it does as a control ends, at the tick’s commit, once per link: a release, a hand-over, a destroy of the entity or its controller, or the scene starting again. The entity may be destroyed already, as the reason says. A control it stages commits at the next commit. A throw is logged in a deployed room and the hooks after it run.
onEntityDestroy? public EntityDestroyHook What it does as an entity leaves the world, inline, before every reference to it is nulled: a destroy, a scene’s restart, an unmount, the stream taking it off a page, or its player leaving, as the context’s reason says. It runs on every world, a page’s too, in plugin order, after the core has released the entity’s attached children and joints. A refused join’s take-back, a checkpoint’s restore and a world’s teardown run none; a plugin’s per-world cleanup is its setup’s return. A destroy of the same entity inside it does nothing, and of another runs that entity’s hooks within. A throw is reported in a deployed world and the hooks after it run. As Unity’s OnDestroy and Unreal’s EndPlay with its reason.
onPlayerDisconnect? public PlayerHook What it does as the player’s connection drops and the room starts holding the player’s seat: the player and what the player controls stay, and ConnectionTrait reads Held. A throw is logged and the drop goes on.
onPlayerJoin? public PlayerJoinHook What it adds to a player as the player joins, before the player’s save restores: a score, a team, a hand of cards. Runs on the room’s tick, or as a game played alone starts, after the hook of each plugin this one requires, with a JoinStep, which reaches the player and what the player’s join spawns alone. A throw refuses the player’s join: every entity the player’s hooks spawned is taken out, with every event they emitted, and nothing the player joined with stays. As Roblox’s PlayerAdded.
onPlayerLeave? public PlayerLeaveHook What it does as the player leaves, the player’s hold ends, a game kicks the player or the room closes, before the core destroys the player entity: destroy what the player alone used, or leave it in the world. A throw is logged and the leave goes on. As Roblox’s PlayerRemoving.
onPlayerReady? public PlayerReadyHook What it does once the player’s save has restored: read the player’s saved choices, spawn what the player plays. Runs after every onPlayerJoin, and a throw refuses the player’s join as one there does.
onPlayerReconnect? public PlayerHook What it does as the player takes the player back within the hold. A throw is logged and the rejoin goes on.
options? public JsonValue The factory’s options, normalized to JSON: what tells one call’s plugin from another’s, what the welcome compares and what the dump shows. A factory whose parameter takes options records them, which RecordedOptions requires; a factory that takes none leaves it out.
partyRule? public PartyRule Its answer to the party question the core asks: the group each player queues and stays with. At most one listed plugin declares it, as parties() does; a platform’s party may answer it later.
requires readonly readonly string[] The plugins this one needs listed, by name.
requiresSystems readonly readonly SystemHandle<"input" | "rules" | "motion" | "physics", boolean, RunContext>[] The systems this one needs running, by handle.
saves readonly Saves One typed handle per save, shop.saves.stock: what another save’s requires names, and what an error names the save by.
setup? public PluginSetup Per-world registrations, the register* calls: an ability, health’s regeneration, a machine’s traits. A define* call stays at module scope.
systems readonly Systems One typed handle per system, siege.systems.spawn: what another plugin’s before, after, replaces and requires name it by, and what omit takes.
teamRule? public TeamRule Its answer to the team question the core asks for damage, weapons, chase, abilities and nameplates: the teams in play and each entity’s own team. At most one listed plugin declares it, as teams() does; a kit that rebuilds teams declares its own.
weatherRule? public WeatherRule Its answer to the weather question the look asks: what the weather does to the light, the grade and the rain this frame. At most one listed plugin declares it, as weather() does; a kit that rebuilds weather declares its own. A room never asks it.