SpectatorModule
SpectatorModule is used to manage spectators in a game. Spectators are considered to be “out of the game”, and are
generally not affected by events that occur inside the game. Many other modules use SpectatorModule to avoid taking
action on spectators.
Parameters
spectateOnDeath: Iftrue, players become spectators when they die during a game.spectateOnLeave: Iftrue, players who disconnect during a game are treated as spectators. Defaults totrue.
Usage
Import the module:
import com.bluedragonmc.server.module.minigame.SpectatorModuleUse the module in your game’s initialize function:
use(SpectatorModule(spectateOnDeath = true))Call addSpectator(player) and removeSpectator(player) to change a player’s spectator status, or
isSpectating(player) to check it.