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

defineSystem

defineSystem<Of, Name>(entry): SystemDefinition<`${Of}`, true, Both, Name>

Makes a system’s definition, checking what one definition can know: its name, its phase, that a predicted one runs on both ends, that each anchor is a handle or a definition of its phase. What needs the plugin, a sibling the list does not hold, a replacement’s kind or a command the plugin lacks, definePlugin checks, and what needs the whole list, the composer checks as the game’s module loads. Typed by the entry: run takes a PredictedStep for predicted: true, an AuthoritativeStep for an unpredicted entry with no runsOn, and an UnpredictedStep for Both or Client.

Type Parameter
Of extends Phase
Name extends string
Parameter Type
entry PredictedSystemEntry<Of, Name>

SystemDefinition<`${Of}`, true, Both, Name>

defineSystem<Of, Name>(entry): SystemDefinition<`${Of}`, false, Server, Name>

Makes a system’s definition, checking what one definition can know: its name, its phase, that a predicted one runs on both ends, that each anchor is a handle or a definition of its phase. What needs the plugin, a sibling the list does not hold, a replacement’s kind or a command the plugin lacks, definePlugin checks, and what needs the whole list, the composer checks as the game’s module loads. Typed by the entry: run takes a PredictedStep for predicted: true, an AuthoritativeStep for an unpredicted entry with no runsOn, and an UnpredictedStep for Both or Client.

Type Parameter
Of extends Phase
Name extends string
Parameter Type
entry AuthoritativeSystemEntry<Of, Name>

SystemDefinition<`${Of}`, false, Server, Name>

defineSystem<Of, Name, RunsOn>(entry): SystemDefinition<`${Of}`, false, RunsOn, Name>

Makes a system’s definition, checking what one definition can know: its name, its phase, that a predicted one runs on both ends, that each anchor is a handle or a definition of its phase. What needs the plugin, a sibling the list does not hold, a replacement’s kind or a command the plugin lacks, definePlugin checks, and what needs the whole list, the composer checks as the game’s module loads. Typed by the entry: run takes a PredictedStep for predicted: true, an AuthoritativeStep for an unpredicted entry with no runsOn, and an UnpredictedStep for Both or Client.

Type Parameter
Of extends Phase
Name extends string
RunsOn extends Client | Both
Parameter Type
entry WorldSystemEntry<Of, Name, RunsOn>

SystemDefinition<`${Of}`, false, RunsOn, Name>