Duel requests
How players challenge each other, accept or decline, and why a request can be refused.
A duel always starts with a request. The challenged player gets a title on screen, a sound, and a chat message with clickable buttons, so nobody misses it and nobody has to type a command to answer.
Sending a request
/duel <player>
/duel challenge <player>Both do the same thing. The second form always works, even when a player's name is the same as a subcommand. A player called top is challenged with /duel challenge top, because /duel top opens the leaderboard.
The challenged player gets:
- A title and subtitle. The text lives in the language file under
request.titleandrequest.subtitle, and the fade times inconfig.yml. - A chat message with [ACCEPT] and [DECLINE] buttons that run the accept and decline commands for them. Hover text explains each button.
- The
request-receivedsound.
The sender gets a confirmation message and the request-sent sound.
Answering
/duel accept [player]
/duel decline [player]With no name, the command answers the newest request. A player can have several requests waiting at once. Accepting one cancels every other request they have sent or received, and the other players are told why. A player waiting in a queue leaves it when the setup menu opens.
Accepting opens the setup menu for both players.
Challenges are unranked. Ranked duels come from the matchmaking queue, so players cannot pick their ranked opponent. Set queue.ranked-challenges: true in config.yml to allow Ranked in challenges again.
When a request is refused
The sender gets a clear message and the request-denied sound when:
| Situation | Message key |
|---|---|
| The sender challenges themselves | request.self |
| The sender is already in a duel, a setup menu or a countdown | request.you-busy |
| The target is already in a duel, a setup menu or a countdown | request.target-busy |
| The sender already has a request waiting with that player | request.already-sent |
| The sender is still on cooldown | request.cooldown |
| The target is offline or hidden from the sender | general.player-not-found |
The sender does not have zrivalsduels.duel | general.no-permission |
Hidden means the sender cannot see the target, for example because of a vanish plugin. The plugin treats that the same as offline, so it never gives away a vanished player.
Settings
All in config.yml under requests:
requests:
# Seconds before an unanswered duel request expires
expire-seconds: 60
# Seconds a player must wait between sending requests
cooldown-seconds: 10
title:
# Show a title to the player who receives a request
enabled: true
# Title fade in time in ticks
fade-in: 10
# Title stay time in ticks
stay: 60
# Title fade out time in ticks
fade-out: 10| Key | What it does | Default |
|---|---|---|
expire-seconds | How long a request waits before it expires. Both players are told when it does | 60 |
cooldown-seconds | Wait between requests from the same sender. zrivalsduels.bypass.cooldown skips it | 10 |
title.enabled | Show the title and subtitle to the challenged player | true |
title.fade-in, title.stay, title.fade-out | Title timings in ticks (20 ticks is one second) | 10, 60, 10 |
To turn off the chat message or change the buttons, edit request.received in the language file. To silence a sound, set its name to "" under sounds in config.yml.
The default subtitle says /duel accept. If you rename the command in commands.yml, edit request.subtitle too, it is plain text.