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

MatchRule

What a plugin declares to answer the match question, as matches() does; at most one listed plugin declares one.

Property Type Description
scopeTraits? readonly Trait[] The traits whose add or remove can change findMatch’s answer, such as a match’s own and a member’s, which the scene hears to read a members-only body’s match again. The core’s owner, presence and control it hears itself. Left out, the scene reads the answer at each pair, as it cannot cache what it cannot hear change.
traits? readonly Trait[] The traits its answers read, which a view of the answer, such as nameplates, watches to read it again as they change.

findMatch(world, entity): MatchEntity | null

The match entity belongs to, or null where it belongs to none. The core asks it only for a live entity of the world, and a match’s own entity belongs to itself.

Parameter Type
world World
entity Entity

MatchEntity | null


optional findMatchTeam(world, entity): Team | null

The team entity holds in its match, a member’s slot’s or a match’s own NPC’s, or null where the match gives it none: the team question asks it before the team rule, so a match’s team is scoped by its match. Left out, no match gives a team.

Parameter Type
world World
entity Entity

Team | null


optional findRespawnPoints(world, player): { place: number; points: readonly Vector3[]; } | null

Where player, a member, comes back as the player’s character respawns at the spawn: the match’s points for the player’s side, and the player’s place among them, from which the core takes the first point no character stands on. Null where the player’s match places none, for the room’s points.

Parameter Type
world World
player Entity

{ place: number; points: readonly Vector3[]; } | null


optional isAlly(world, match, first, second): boolean | undefined

Whether first and second, both of match, fight on one side; undefined leaves it to the team question, as a co-op match does.

Parameter Type
world World
match MatchEntity
first Instigator
second Entity

boolean | undefined


optional isDamageAcrossMatchesEnabled(world): boolean

Whether a hit lands between two matches, and between a match and an entity in none. Left out, or false, each is spared.

Parameter Type
world World

boolean


optional isDamageOutsideMatchesEnabled(world): boolean

Whether a hit lands between two player-backed entities in no match. Left out, or false, it is spared, so the park is safe.

Parameter Type
world World

boolean


optional readMatchNumber(world, match): number

The contest match plays now, a number that rises at each reset, which an instigator keeps as it acts. Left out, every contest is 0.

Parameter Type
world World
match MatchEntity

number


optional readMatchTeams(world): readonly Team[]

Every team a match gives, which a team’s key is read back by.

Parameter Type
world World

readonly Team[]