Contests (Events)
On this page(27)
Contests are scheduled competitive events, shown to players as /event. During an event, targets appear in each player's zone at a fixed rate, the same for everyone. Players catch them with their own click. The score rewards attention and speed, never power.
| Files | modules/contests/config.yml, modules/contests/variants/ (one file per variant), modules/contests/lang/messages_en.yml |
| Player command | /event (alias /eventos) |
| Admin commands | /dungeons admin contests ... |
| Switch | enabled: (first key of modules/contests/config.yml) + /dungeons reload |
With the module off, a running event is saved with the time it has left. It goes on when the module is on again.
How it works
Fair by design
In SnDungeons a kill does not cost everyone the same: more damage and swings kill more. An event that counted kills would reward power. So a contest counts only one thing: a direct click on a target.
- Damage, swings, boosters, enchants, AFK clones, heroes and the autofighter play no part.
- The auto-swing does not catch targets. Only the player's own click does.
- A target nobody clicks escapes.
The fixed rate also puts a ceiling on the score. A 5 minute event with a target every 3 seconds gives at most 100 targets. An auto-clicker cannot pass it.
The schedule
An event starts at base-time + n x interval-minutes of each day, in timezone. With 00:00 and 120, events start at 00:00, 02:00, 04:00 and so on. Each one takes the next variant of rotation.
With fewer than minimum-players players in the mob area of their zone, the event is skipped. The skip is announced, with the next event.
Taking part
Every player who stands in the mob area of their zone takes part. There is nothing to join.
- A player who leaves the mob area gets no targets while away, but keeps their score.
- Coming back gives no burst of the missed targets.
- Each player hunts only their own targets. Only they see them, so nobody can steal them.
A boss bar per participant shows the time left, their place and their score. It updates once a second.
The end
When the time runs out:
- The top is announced (
announce:). - The place rewards of the variant are paid.
- Every player with at least
participation.min-scoregets the participation reward. - A first place above the variant's record sets a new record.
A player offline at the end gets their rewards at their next join. Ties go to whoever reached that score first.
A restart in the middle of an event goes on with the time it had left. The scores come from the last save (storage.save-seconds).
Variant types
| Type | Shipped example | How it plays |
|---|---|---|
hunt | golden-hunt | A target appears at a random point of the ground of your mob area. A click is +1. |
weak-points | weak-points | No new mobs. A mark appears over one of your zone mobs. A click on it is +1. |
combo | combo | Like hunt, with a multiplier that rises with catches in a row. |
In weak-points, a click on the mark never touches your fight: your auto-swing keeps its target. A mark whose mob dies goes without scoring.
In combo, every combo.step catches in a row raise the multiplier by combo.increase, up to combo.max. Each catch scores 1 x the multiplier. An escape resets it to 1. The boss bar shows it.
Click checks
The fixed rate is the ceiling, but a modified client could click every target at once, from far away or without looking. So every click is checked before it counts (anti-cheat:):
| Check | Fails when |
|---|---|
| Reach | The eyes are farther than max-distance from the target's box. Vanilla reaches 3; the rest is room for ping. |
| Look | A ray of the player's last rotation misses the box grown by look-tolerance, or a solid block is in between. |
| Decoy | The player clicks a decoy: an invisible target inside the ground, one every decoy-every real targets. |
A vanilla client can never see nor click a decoy. It has the same type and name as a real target.
A click that fails adds nothing, and the target stays. The staff with sndungeons.admin.contests.alerts get an alert. Nobody is punished automatically: the staff decides.
With the Anticheat module on, the alerts come from it instead (checks contest-reach, contest-look and contest-decoy). The click is refused the same way.
Configuration
schedule
| Key | Default | What it does |
|---|---|---|
schedule.base-time | '00:00' | The first start time of each day. |
schedule.timezone | 'UTC' | A time zone id: UTC, Europe/Madrid, America/Argentina/Buenos_Aires... |
schedule.interval-minutes | 120 | Minutes between two events (1 to 10080). |
schedule.minimum-players | 1 | Players in the mob area of their zone an event needs. With fewer, it is skipped. 0 = always starts. |
schedule.rotation | [golden-hunt, weak-points, combo] | The variants in turn. An id that is not loaded is skipped with a warning. Empty = no scheduled event. |
An admin can still start an event with an empty rotation.
bossbar
| Key | Default | What it does |
|---|---|---|
bossbar.title | '{variant} &8| &7Ends in &f{time} &8| &e#{rank} &7({score})' | The title. {variant}, {time} (time left), {rank}, {score}. |
bossbar.color | YELLOW | PINK, BLUE, RED, GREEN, YELLOW, PURPLE or WHITE. |
bossbar.style | SOLID | SOLID, SEGMENTED_6, SEGMENTED_10, SEGMENTED_12 or SEGMENTED_20. |
Only each participant sees their own bar. A combo event adds labels.bossbar-multiplier of the module messages.
announce
The chat lines go to every player with the contests.announcements setting on.
| Key | Default | What it does |
|---|---|---|
announce.start | one line | When an event starts. {variant}, {duration}. |
announce.end-header | '&6&l{variant} &7ended! Top:' | The first line at the end. |
announce.end-line | ' &e#{rank} &f{player} &7- &e{score}' | One line per place. {rank}, {player}, {score}. |
announce.top-display-limit | 5 | The places listed after an event (0 to 100). |
announce.record | one line | A new record. {player}, {score}, {variant}, {previous}. |
anti-cheat
| Key | Default | What it does |
|---|---|---|
anti-cheat.max-distance | 4.5 | Most blocks from the eyes to the target's box. Below 3 is refused and 4.5 is used. |
anti-cheat.look-tolerance | 0.6 | Blocks the box grows by for the look check (0 to 2). |
anti-cheat.decoy-every | 15 | One decoy every N real targets of a player. 0 = none. |
anti-cheat.alert | '&c[Event] &f{player} &7failed &c{check} &7({detail}) &8x{count}' | The staff alert. {check}, {detail} (a distance or an angle), {count} (failed clicks in this event). |
anti-cheat.alert-cooldown-seconds | 10 | At most one alert per player this often. The ones in between add to {count}. |
The look tolerance exists because the client sends a click before the rotation of that same tick.
storage
| Key | Default | What it does |
|---|---|---|
storage.save-seconds | 30 | Seconds between two saves of a running event's scores (5 to 3600). |
commands.main
| Key | Default | What it does |
|---|---|---|
commands.main.command | event | Command name. '' = no /event command (the API keeps working). |
commands.main.aliases | [eventos] | Other names of the command. |
commands.main.permission | '' | Permission needed to use the command. '' = everyone. |
The display-name key ('&6Eventos') is the module's name in /dungeons admin modules.
Variant files
Each file of modules/contests/variants/ is one variant. The file name is its id. The folder is created with three examples only while it does not exist. From then on the files are yours: never merged.
Common keys
| Key | Golden Hunt value | What it does |
|---|---|---|
type | hunt | hunt, weak-points or combo. An unknown type keeps the variant out. |
name | '&6&lGolden Hunt' | The name shown as {variant}. |
duration-minutes | 5 | How long the event lasts (1 to 1440). |
spawn.every-seconds | 3.0 | The FIXED time between two targets of a player (0.5 or more). The best score is duration / every-seconds. |
spawn.max-alive | 3 | Targets of one player alive at once (1 to 10). |
spawn.escape-seconds | 6 | Seconds a target lives without a click (1 or more). |
target
| Key | Golden Hunt value | What it does |
|---|---|---|
target.entity | ZOMBIE | Any mob type (ZOMBIE, PIG, SLIME...). |
target.baby | false | true = half size, hitbox included. |
target.glow | GOLD | The color of its glowing outline (GOLD, RED, AQUA...). '' = no glow. |
target.name | '&6&lGolden Mob' | The name over it. '' = none. |
target.head.texture | '' | A base64 head texture it wears (basehead- allowed). '' = none. |
target.catch-particle | TOTEM_OF_UNDYING | The particle of a catch. '' = none. |
target.catch-sound | ENTITY_EXPERIENCE_ORB_PICKUP | The sound of a catch. '' = none. |
target.escape-particle | SMOKE | The particle of an escape. '' = none. |
Particles that need data (a color, a block) are refused.
In a weak-points variant, the target: block only names the particles and sound. Its decoys are boxes inside the ground under the mob.
mark (weak-points)
| Key | Weak Points value | What it does |
|---|---|---|
mark.text | '&c&l✖' | The text over the mob's head. |
mark.width, mark.height | 0.8 | The size of the clickable box, in blocks (0.1 to 4). |
mark.offset | 0.3 | Blocks between the top of the mob and the bottom of the box. |
combo (combo)
| Key | Combo value | What it does |
|---|---|---|
combo.step | 5 | Catches in a row that raise the multiplier. |
combo.increase | 0.5 | How much each step raises it. |
combo.max | 3.0 | Its cap. |
Rewards
| Key | What it does |
|---|---|
rewards.'<place>' | Action lines for that place ('1', '2'...). A line without a [tag] runs as [console]. |
participation.min-score | The score a player needs for the participation reward. 0 = no participation reward. |
participation.rewards | Action lines for every player who reached min-score. |
{player}, {variant} and {rank} work in the reward lines. The shipped variants pay with [give-crystal-box] and [give-currency]. See Menus and Action Tags for the tags.
modules/contests/variants/golden-hunt.yml (rewards)
rewards:
'1':
- '[give-crystal-box] 5 1'
- '[give-currency] souls 5000000'
'2':
- '[give-crystal-box] 2 2'
participation:
min-score: 20
rewards:
- '[give-currency] souls 100000'Player settings
| Setting | What it hides (for that player only) |
|---|---|
contests.bossbar | The boss bar of a running event. |
contests.announcements | The chat lines of a start, a skipped start, the top at the end and a new record. |
The replies to a player's own commands always show. See Player Settings.
Objectives
Contests feed two objective types: contest-points (the points scored) and contest-place (an event ended by its time with the player placed). Hunts can count both.
Commands
| Command | Permission | Description |
|---|---|---|
/event | commands.main.permission ('' = everyone) | Shows the running event with your place and score, or the next one. It has no menu. |
/dungeons admin contests start <variant> | sndungeons.admin.contests.start | Starts a contest of a variant now. |
/dungeons admin contests stop [reward] | sndungeons.admin.contests.stop | Ends the running event. Without reward it pays nothing and sets no record; with it, it pays as finished. |
/dungeons admin contests next | sndungeons.admin.contests.next | Starts the next contest of the rotation now. |
/dungeons admin contests score <player> <set|add> <n> | sndungeons.admin.contests.score | Sets or adds to a player's score in the running contest. |
/dungeons admin contests info | sndungeons.admin.contests.info | Shows the running contest, its top, the schedule and the records. |
/dungeons admin contests alerts | sndungeons.admin.contests.alerts | Switches your own event check alerts off or on. Holders of this node receive the alerts. |
Each staff member's alert choice is kept after a relog and a restart. Full lists: Commands and Permissions.
Placeholders
The contest placeholders are listed in Placeholders. The most useful:
| Placeholder | Value |
|---|---|
%sndungeons_contest_status% | running or idle (_label for the word) |
%sndungeons_contest_current%, _time_left | The running variant's name and its time left |
%sndungeons_contest_next%, _next_variant | Time until the next scheduled event, and its variant |
%sndungeons_contest_score%, _rank | Your score and place in the running event |
%sndungeons_contest_top_<n>_name%, _top_<n>_score | A place of the running ranking |
%sndungeons_contest_record_<variant>_name%, _record_<variant>_score | The record of a variant |
Tips
- Test a variant with
/dungeons admin contests start <variant>, thenstopwithoutrewardto pay nothing. spawn.every-secondsandduration-minutesset the ceiling. Changing them makes the variant's old record easier or harder to beat.- Keep
max-distanceat 4.5: values below 3 would refuse legal players, so they are refused. - Nobody is punished automatically. Check a player's
{count}over several events before you act.
Default modules/contests/config.yml
enabled: true
# ============================================================
# SnDungeons - contests module (/event)
# Managed by SnLib: new keys are auto-merged on boot; your values and
# comments are preserved. Re-read on /dungeons reload.
# ============================================================
# Switch of the module (the key above): false turns the events off on
# /dungeons reload; a running event is saved with the time it has left and
# goes on when the module is switched on again.
# An event (a "contest") is fair by design: targets appear in the mob area
# of each player's zone at the SAME fixed rate for everyone and are caught
# with the player's own click. Damage, swings, boosters, enchants, afk
# clones, heroes and the autofighter play no part: the score measures how
# attentive and quick the player is, and the rate puts a ceiling on it that
# nobody can pass (an auto-clicker included).
# The variants are the files of modules/contests/variants/ (created with
# examples only while the folder does not exist; yours from then on).
# Name of the module in /dungeons admin modules (color codes allowed).
display-name: '&6Eventos'
schedule:
# The events start at base-time + n x interval-minutes of each day, in
# timezone (like CropEvent): with 00:00 and 120, at 00:00, 02:00, 04:00...
base-time: '00:00'
# A time zone id: UTC, Europe/Madrid, America/Argentina/Buenos_Aires...
timezone: 'UTC'
# Minutes between two events (1 to 10080).
interval-minutes: 120
# Players standing in the mob area of their zone that an event needs when
# its time comes; with fewer it is skipped (announced) and the next one
# takes the next variant. 0 = it always starts.
minimum-players: 1
# The variants in turn (ids of modules/contests/variants/); an id that is
# not loaded is skipped with a warning. Empty = no scheduled event (the
# admin can still start one).
rotation:
- golden-hunt
- weak-points
- combo
# The boss bar of each participant (only they see theirs), updated once a
# second. {variant}: the variant's name; {time}: time left; {rank}: their
# place; {score}: their score. A combo event adds labels.bossbar-multiplier
# of the messages. The setting contests.bossbar hides it per player.
bossbar:
title: '{variant} &8| &7Ends in &f{time} &8| &e#{rank} &7({score})'
# PINK, BLUE, RED, GREEN, YELLOW, PURPLE or WHITE.
color: YELLOW
# SOLID, SEGMENTED_6, SEGMENTED_10, SEGMENTED_12 or SEGMENTED_20.
style: SOLID
# The chat lines of an event, to every player with the setting
# contests.announcements on.
announce:
# When it starts. {variant}, {duration}.
start:
- '&6&l{variant} &7started! Catch the targets in your zone. &f{duration}'
# When it ends with rewards: the header, then one line per place.
end-header: '&6&l{variant} &7ended! Top:'
# {rank}, {player}, {score}.
end-line: ' &e#{rank} &f{player} &7- &e{score}'
# The places listed after an event (0 to 100).
top-display-limit: 5
# A new record of the variant. {player}, {score}, {variant}, {previous}.
record: '&d&lNEW RECORD! &f{player} &7scored &e{score} &7in {variant} (previous: {previous}).'
# The checks of every click on a target, before it counts. A click that
# fails adds nothing (the target stays) and tells the staff with the
# permission sndungeons.admin.contests.alerts (each one switches them with
# /dungeons admin contests alerts). Nobody is punished automatically.
anti-cheat:
# Most blocks from the eyes to the target's box (vanilla reaches 3; the
# rest is room for the ping). Below 3 would refuse legal players: it is
# refused and 4.5 is used.
max-distance: 4.5
# Blocks the target's box grows by for the look check (0 to 2): the
# client sends a click before the rotation of that same tick.
look-tolerance: 0.6
# One decoy every N real targets of a player: an invisible target inside
# the ground that a vanilla client can never see nor click. 0 = none.
decoy-every: 15
# The staff alert. {player}, {check} (labels.check-* of the messages),
# {detail} (the distance or the angle), {count} (failed clicks of the
# player in this event).
alert: '&c[Event] &f{player} &7failed &c{check} &7({detail}) &8x{count}'
# At most one alert per player every N seconds; the ones in between are
# counted in the {count} of the next.
alert-cooldown-seconds: 10
storage:
# Seconds between two saves of the scores of a running event (5 to 3600).
# A restart goes on with the time the event had left and the scores of
# the last save.
save-seconds: 30
commands:
# /event shows the event running (time left, your place and score) or the
# next one. If another plugin already has this name or an alias,
# SnDungeons takes it (command priority).
main:
# Command name; '' = no /event command (the API keeps working).
command: event
# Other names of the command.
aliases:
- eventos
# Permission needed to use the command. '' = everyone.
permission: ''Example variant: modules/contests/variants/golden-hunt.yml
# ============================================================
# SnDungeons - contest variant: Golden Hunt (the file name is its id)
# Yours: this folder is created with examples only while it does not
# exist and never merged. Re-read on /dungeons reload.
# ============================================================
# hunt: every spawn.every-seconds a target appears at a random point of the
# ground of the player's mob area (while they have fewer than max-alive);
# a click on it is +1, and it escapes after escape-seconds without one.
type: hunt
name: '&6&lGolden Hunt'
# How long the event lasts (1 to 1440).
duration-minutes: 5
spawn:
# The FIXED time between two targets of a player, the same for everyone
# (0.5 or more). The best score possible is duration / every-seconds.
every-seconds: 3.0
# Targets of one player alive at once (1 to 10).
max-alive: 3
# Seconds a target lives without a click (1 or more).
escape-seconds: 6
target:
# Any mob type (ZOMBIE, PIG, SLIME...).
entity: ZOMBIE
# true = half size (its hitbox too).
baby: false
# The color of its glowing outline (GOLD, RED, AQUA...); '' = no glow.
glow: GOLD
# The name over it; '' = none.
name: '&6&lGolden Mob'
head:
# A base64 head texture it wears (basehead- allowed); '' = none.
texture: ''
# The particle and sound of a catch, and the particle of an escape ('' =
# none). Particles that need data (a color, a block) are refused.
catch-particle: TOTEM_OF_UNDYING
catch-sound: ENTITY_EXPERIENCE_ORB_PICKUP
escape-particle: SMOKE
# The rewards of each place when the event ends (plugin actions; a line
# without a [tag] runs as [console]). {player}, {variant} and {rank} work in
# them. A player offline at the end gets them at their next join.
rewards:
'1':
- '[give-crystal-box] 5 1'
- '[give-currency] souls 5000000'
'2':
- '[give-crystal-box] 2 2'
'3':
- '[give-crystal-box] 1 2'
'4':
- '[give-currency] souls 1000000'
'5':
- '[give-currency] souls 500000'
# The reward of every player who reached min-score (0 = no participation
# reward).
participation:
min-score: 20
rewards:
- '[give-currency] souls 100000'