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

Plugin

What definePlugin makes: the config, branded, with a typed handle per command, per input and per system.

  • Omit<PluginConfig, "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
Property Modifier Type Description
[pluginBrand] readonly true -
[pluginEntries] readonly PluginSystems -
actions readonly PageActionHandles<Actions> One handle per declared page action, siege.actions.ready.
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: default views, context and hooks’ providers. Game nests each plugin’s around the scenes and the HUD in list order, the first outermost; headless its views render nothing and the scene still mounts. It always renders its children.
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.
name public string "abilities", "siege", "frost-nova": the dump lists it, and every system of the plugin is named plugin.system after it.
onCharacterRespawn? public CharacterRespawnHook What it does as a downed character stands again, on the world that decides outcomes: refill her ammo, reset her buffs. As what a Roblox game puts in CharacterAdded for each life.
onCharacterSpawn? public CharacterSpawnHook What it adds to a character as she appears, from the scene’s CharacterSpawn props: a trait, an ability, a bag. Receives the authority she was spawned under, her entity, and her player and the props. It runs where she 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 she holds her base traits and before her save restores onto her, 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, so 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.
onPlayerDisconnect? public PlayerHook What it does as her connection drops and the room starts holding her seat: her player and what she 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 she joins, before her 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 her and what her join spawns alone. A throw refuses her join: every entity her hooks spawned is taken out, with every event they emitted, and nothing she joined with stays. As Roblox’s PlayerAdded.
onPlayerLeave? public PlayerLeaveHook What it does as she leaves, her hold ends, a game kicks her or the room closes, before the core destroys her player entity: destroy what she 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 her save has restored: read her saved choices, spawn what she plays. Runs after every onPlayerJoin, and a throw refuses her join as one there does.
onPlayerReconnect? public PlayerHook What it does as she takes her 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 the welcome compares and the dump shows. A plugin with no options leaves it out.
requires readonly readonly string[] The plugins this one needs listed, by name.
requiresSystems readonly readonly SystemHandle<"input" | "motion" | "rules" | "physics", boolean, RunContext>[] The systems this one needs running, by handle.
resources? public readonly ResourceKey[] The resources every character has, by the keys defineResource returns, [focus]: each given to her as she spawns, before the plugin’s own onCharacterSpawn, where its settings say it starts. The CharacterSpawn’s resources gives one to a character of the scene’s own.
save? public false | PluginSave<SaveSchema, "entity" | "world" | "player"> What it keeps in a player’s save: a version, a schema, read, restore and numbered migrations, as defineSave takes them. A game’s plugin keeps it under kits.<name>, keyed by its name, on once the game lists the plugin. false turns it off, as a kit’s factory does for its save: false option: the stored key is then kept untouched.
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.