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

PluginConfig

What definePlugin takes.

Type Parameter Default type
Schema extends SaveSchema SaveSchema
Scope extends SaveScopeName SaveScopeName
Systems extends object PluginSystems
Inputs extends InputDeclarations NoInputs
Actions extends PageActionDeclarations NoPageActions
Layers extends string string
Commands extends CommandDeclarations NoCommands
Contexts extends InputContextDeclarations NoInputContexts
Property Type Description
actions? Actions Keys the page acts on and the room never hears, each pageAction({ keys }) and named plugin.key: the page runs what useAction registers for one.
collisionLayers? readonly Layers[] The collision layers its bodies stand in, by name, each a handle plugin.collisionLayers.key that a body’s collisionLayer names and a mask lists. The composer numbers them in list order after the core’s two and the characters’ two, 16 in all.
commands? Commands The actions a player asks the room for, each defineCommand(fields, options) and named plugin.key: one system names each in its answers and reads it with readCommands, and a page sends it with sendCommand. A predicted one, predicted: true, runs on her page at once as a guess and on the room, which confirms it.
component? 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? Contexts Input contexts a control names, each inputContext({ priority, inputs }) and named plugin.key: while she controls an entity under one, its inputs take the keys they share with a lower live context’s.
description? string -
inputs? Inputs Held inputs that ride every tick’s input to the room, each buttonInput(), axisInput(min, max), vector2Input() or angleInput() and named plugin.key: a system reads one with readInput(character, handle). At most maximumInputBytes a tick across the game’s plugins.
name string "abilities", "siege", "frost-nova": the dump lists it, and every system of the plugin is named plugin.system after it.
onCharacterRespawn? 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? 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? 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? 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? 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? 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? 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? PlayerHook What it does as she takes her player back within the hold. A throw is logged and the rejoin goes on.
options? 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 Requirement[] What this one needs on the same world: plugins, by the plugin or its engine factory, and systems, by their handles, requires: [stats, behaviours.systems.capHealth].
resources? 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? false | PluginSave<Schema, Scope> 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? PluginSetup Per-world registrations, the register* calls: an ability, health’s regeneration, a machine’s traits. A define* call stays at module scope.
systems? Systems -
teamRule? 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.