zRivals Duels logozRivals Duels

Spectating

Watching running duels with /duel spectate, where spectators are placed, what they can do, and how they are sent back.

Players can watch any running duel. Spectators are put in spectator mode inside the arena, so the fighters cannot see them, hit them or be blocked by them. When the duel ends they go back to where they were, in the game mode they had.

Commands

CommandWhat it doesPermission
/duel spectateList every running duel. Click a line to watch itzrivalsduels.spectate
/duel spectate <player>Watch the duel that player is fightingzrivalsduels.spectate
/duel leaveStop watching and go backnone

The list shows both players, the kit and the mode of each duel in its countdown or fight. Tab completion on /duel spectate suggests the names of players who are fighting. Both labels can be renamed in commands.yml, see Commands file.

Who can watch

  • Players in a duel, or in a duel setup menu, cannot watch. They are told "You cannot watch a duel while you are in one".
  • A player cannot watch their own duel.
  • The duel has to be in its countdown or fight. A duel that is still starting or already ending cannot be joined.
  • A player who is already watching can switch to another running duel with /duel spectate <player>, no need to leave first.

Where spectators are placed

Arena hasSpectators appear
A spectator pointAt that point, facing the way it was set
No spectator point3 blocks above the middle of the two spawns and 4 blocks to the side, looking across the arena

Set the point with /duel arena setspectator <arena>, see Arenas. When an arena has no spectator point and its spawns are missing or in different worlds, the duel cannot be watched.

While watching

Spectators are in spectator mode. Their inventory, health, XP and effects are left as they are.

ActionRule
Fighting, picking up, placing, blocking arrowsNot possible, spectator mode does not interact with the duel
Being seenFighters cannot see spectators
MovingFree inside the sides of the arena boundaries. Flying past a side puts the spectator back
Viewing through a fighterAllowed. Left click a fighter to see through their eyes
TeleportsBlocked, including /spawn, /home and other plugins' teleports. The spectator hotbar teleport works when the target is inside the arena sides
Game mode changesBlocked, including /gamemode
ContainersBlocked

A blocked teleport tells the spectator to use /duel leave first.

When spectators are sent back

Spectators get their location, game mode and flight back, and nothing else changes. That happens when:

  • they run /duel leave
  • the duel finishes, after the winner delay. They are told "The duel you were watching is over"
  • they log out
  • the server stops
  • they accept a duel request, or someone accepts theirs. They are sent back first, then the setup menu opens

A spectator who is viewing through a fighter is detached before that fighter is restored, so the camera never follows the fighter out of the arena.

Crash safety

When a player starts watching, their location, game mode and flight are saved to the database. If the server crashes while they watch, they are sent back when they next join, with the message "You were sent back to where you were before watching the duel". Only the location, game mode and flight are restored, never the inventory, health or effects, so nothing is duplicated and no potion time is given back.

Telling the fighters

When someone starts watching, both fighters get a short "is watching your duel" line.

  • spectate.notify-players: false turns it off for everyone.
  • Players with zrivalsduels.spectate.silent never trigger it. Operators have it by default.

config.yml

spectate:
  # Let players watch running duels with /duel spectate
  enabled: true
  # Tell both fighters when someone starts watching their duel
  notify-players: true
KeyWhat it doesDefault
enabledfalse turns off /duel spectate for everyone. Players already watching stay until they leave or the duel endstrue
notify-playersTell both fighters when someone starts watchingtrue

Permissions

NodeWhat it grantsDefault
zrivalsduels.spectate/duel spectateeveryone
zrivalsduels.spectate.silentWatch without the fighters being toldop

Every spectate message is in the spectate section of the language file, see Messages and Language.

On this page