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
| Command | What it does | Permission |
|---|---|---|
/duel spectate | List every running duel. Click a line to watch it | zrivalsduels.spectate |
/duel spectate <player> | Watch the duel that player is fighting | zrivalsduels.spectate |
/duel leave | Stop watching and go back | none |
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 has | Spectators appear |
|---|---|
| A spectator point | At that point, facing the way it was set |
| No spectator point | 3 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.
| Action | Rule |
|---|---|
| Fighting, picking up, placing, blocking arrows | Not possible, spectator mode does not interact with the duel |
| Being seen | Fighters cannot see spectators |
| Moving | Free inside the sides of the arena boundaries. Flying past a side puts the spectator back |
| Viewing through a fighter | Allowed. Left click a fighter to see through their eyes |
| Teleports | Blocked, including /spawn, /home and other plugins' teleports. The spectator hotbar teleport works when the target is inside the arena sides |
| Game mode changes | Blocked, including /gamemode |
| Containers | Blocked |
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: falseturns it off for everyone.- Players with
zrivalsduels.spectate.silentnever 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| Key | What it does | Default |
|---|---|---|
enabled | false turns off /duel spectate for everyone. Players already watching stay until they leave or the duel ends | true |
notify-players | Tell both fighters when someone starts watching | true |
Permissions
| Node | What it grants | Default |
|---|---|---|
zrivalsduels.spectate | /duel spectate | everyone |
zrivalsduels.spectate.silent | Watch without the fighters being told | op |
Every spectate message is in the spectate section of the language file, see Messages and Language.