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

TeamRule

What a plugin declares to answer the team question, as teams() does; at most one listed plugin declares one. The core walks an entity’s controller and presence first, then asks findMembership for the entity’s own team. As Unreal’s SetAttitudeSolver, one place answers every system that asks.

Property Modifier Type Description
teams readonly readonly Team[] The teams in play, in order.
traits? public readonly Trait[] The traits its answers read, which a view of the answer, such as nameplates, watches to read it again as they change.

findMembership(world, entity): TeamMembership | null

The entity’s own team, or null where it has none: one of teams.

Parameter Type
world World
entity Entity

TeamMembership | null


isFriendlyFireEnabled(world): boolean

Whether a hit between allies applies.

Parameter Type
world World

boolean


optional isTeamAlly(world, first, second): boolean

Whether two teams fight on one side; one team is always its own ally. Left out, two teams are allies only when they are one. It must answer the same both ways round.

Parameter Type
world World
first Team
second Team

boolean