DriftEvents
KOTH, drops and chat games on a schedule.
Server events for Paper and Folia 26.3: KOTH, supply drops, drop parties, chat games and competitions, started by
staff or on a schedule, with a /events menu of what's on and coming up. Part of DriftSuite.
Features
- KOTH: hills are boxes set with a wand (left-click one corner, right-click the other) or
/event koth pos1andpos2, then/event koth create <name>. Stand on the hill alone forcapture-secondsto win. Two sides on it at once is contested and the capture pauses; when another side takes over it starts from zero. A boss bar shows who's capturing. Optional time limit, and progress can drain while nobody's on the hill. - Teams in KOTH: with DriftTeams installed, a whole team is one side: teammates capture together and never contest each other, and the capture is announced under the team's name. Allied teams can be set to not contest each other either. Rewards go to the capper, or to everyone on the winning side standing on the hill.
- Supply drops: chests fall at random dry spots in an area (inside the world border), with a falling trail, a
particle beam and the coordinates announced. Tiers (common, rare, legendary) each have their own block, beam and
loot table. Players right-click a chest and click loot to take it. Chests go after a set time, or as soon as
they're empty.
/event supply area <name> <radius>centres the area where you stand. - Drop parties: after a countdown, items from a loot table rain down at a spot, spread evenly over the party.
/event party spot <name>sets the spot where you stand. - Chat games: unscramble a word, type a phrase fastest, solve a sum or answer trivia. Questions, words and
phrases are in
questions.yml. The first right answer in chat wins; the answer is hidden so it can't be copied. Rewards can be the same for every game or set per game. - Competitions: most blocks mined, fish caught or mobs killed in a set time, optionally only some blocks, catches or mobs. A boss bar shows the leader, players see their own score above the hotbar, and the top 3 get rewards.
- Scheduler: any event can start by itself at times of day (on chosen weekdays) or every so many minutes, only when enough players are online.
/eventsmenu: what's on now (with live status and time left), then what's coming up and when. Staff can shift-click an event to start or stop it. The claim box opens from here.- Rewards in the DriftRewards format: rewards are written the same way as in DriftRewards. Items that don't fit and money that can't be paid go to a claim box, and rewards for players who left are given when they join.
- Loot tables:
loot.yml, shared by supply drops and drop parties, with weights and min/max rolls.
Requirements
- Paper or Folia 26.3 (Leaf works), Java 25.
- Optional: DriftTeams (team KOTH), PlaceholderAPI, Vault (or DriftEconomy) for money rewards, DriftCrates for key rewards, Nexo / ItemsAdder / Oraxen for custom item rewards.
- Storage is H2 (a file in the plugin folder) unless you set MySQL or MariaDB. Storage only holds the claim box and rewards waiting for players who were offline.
Getting started
- Put
DriftEvents-<version>.jarinplugins/and start the server. It works without any changes: its files are written toplugins/DriftEvents/, the event files toplugins/DriftEvents/events/and its own data toplugins/DriftEvents/data/(see Folder layout). Chat games and two competitions run on a schedule straight away; KOTH, supply drops and drop parties wait until you set them up. - KOTH:
/event koth wand, left-click one corner of the hill and right-click the other, then/event koth create <name>. Supply drops: stand in the middle and type/event supply area <name> <radius>. Drop parties: stand on the spot and type/event party spot <name>. /event start <name>tries one out. Change rewards and timers in its file inevents/, then/driftevents reload. To run it by itself, setenabled: truein itsschedule:section.
Commands
| Command | What it does | Permission |
|---|---|---|
/events | What's on and coming up, and the claim box | none |
/event start <event> | Start an event now | driftevents.staff |
/event stop <event> | Stop an event (nobody gets its prizes) | driftevents.staff |
/event list | Every event, whether it's running and when it's next due | driftevents.staff |
/event koth wand | A wand: left-click a block for one corner, right-click for the other | driftevents.staff |
/event koth pos1|pos2 | Set a corner where you stand | driftevents.staff |
/event koth create <name> | Make a KOTH from the two corners (or move an existing one's hill) | driftevents.staff |
/event koth delete <name>, /event koth list | Delete or list hills | driftevents.staff |
/event supply area <name> <radius> | Make a supply drop around where you stand (or move its area) | driftevents.staff |
/event party spot <name> | Make a drop party where you stand (or move its spot) | driftevents.staff |
/event help | The /event commands | driftevents.staff |
/driftevents reload | Reload every file and say how many problems it found | driftevents.admin |
/driftevents version | Show the version | driftevents.admin |
/driftevents help | The staff commands | driftevents.admin |
Every name, alias and permission can be changed in commands.yml. No other DriftSuite plugin uses these names.
Permissions
| Permission | Default | What it allows |
|---|---|---|
driftevents.staff | op | /event, the KOTH wand, and shift-clicking events in /events |
driftevents.admin | op | /driftevents reload and version |
Rewards
Every reward is a list of lines, the same as in DriftRewards:
rewards:
- "item: DIAMOND 3" # an item (any Minecraft item name)
- "item: nexo:ruby_sword" # a Nexo, ItemsAdder or Oraxen item
- "money: 500" # money (in "economy" in config.yml)
- "money: 25 gems" # money in another economy
- "key: vote 1" # a DriftCrates key (crate name, amount)
- "xp: 100" # experience points
- "levels: 5" # experience levels
- "command: lp user {player} permission set fly.use" # run by the console
- "message: <gray>Well played!" # a chat message to the player
- "broadcast: <white>{player} <gray>won!" # a message to everyone
- "title: <gold>Winner!|<gray>Well played" # a title|subtitle
- "actionbar: <gray>+1 point" # text above the hotbar
- "sound: entity.player.levelup:1:1" # a sound (name:volume:pitch)
Competitions have one list per place ("1", "2", "3"). Chat games have one list for all games or one per game.
Loot tables use one line per entry, with a weight.
Schedules
Add a schedule: section to any event in its file:
schedule:
times: ["18:00", "21:30"] # times of day, 24 hour clock
days: [SATURDAY, SUNDAY] # only these days (leave out for every day)
every: 45m # or: every 45 minutes instead
min-players: 3 # only when this many are online
enabled: true # false pauses it
Times use time-zone in config.yml. An event that's already running isn't started again. The example KOTH, supply
drop and drop party schedules ship turned off, because their spots need setting first.
Turning features on and off
At the top of config.yml. They apply on /driftevents reload, except placeholders, which needs a restart.
| Switch | What it turns on |
|---|---|
scheduler | Events starting by themselves from their schedules |
chat-games | Chat games |
koth | KOTH |
supply-drops | Supply drops |
drop-parties | Drop parties |
competitions | Competitions |
placeholders | PlaceholderAPI placeholders |
A kind of event that's off can't be started and doesn't show in /events.
Settings
config.yml:
| Setting | What it does |
|---|---|
economy | The money for money: lines: vault, xp or a DriftEconomy currency |
time-zone | The time zone schedule times are in. Empty means the server's own |
chat-games.hide-right-answer | Hide the right answer from chat so it can't be copied |
chat-games.ignore-creative | Players in creative or spectator can't win chat games |
koth.ignore-creative | Creative players don't count as on the hill |
koth.teams | DriftTeams teammates are one side |
koth.allies-dont-contest | Allied teams don't contest each other |
supply-drops.beam-height | How high the particle beam above a chest goes (0 = none) |
competitions.count-spawner-mobs | Count spawner, spawn egg, bred and built mobs |
competitions.show-own-score | Show players their score above the hotbar |
competitions.remember-placed-blocks | How many player-placed blocks are remembered so they don't score |
crate-key-command | The command run for key: lines |
storage | H2, MySQL or MariaDB |
Each event's own settings are explained at the top of its file.
Can't be exploited
- One winner per prize. Every event ends exactly once (one atomic switch): either it finishes and hands out its prizes, or staff stop it and nobody gets anything. Two right answers to a chat game at the same moment, or a KOTH capture landing with the time limit, can't both pay.
- Supply drop loot is taken atomically. A chest's loot sits in one shared menu. Taking a slot removes it under the chest's lock before anything is given, so two players clicking the same slot get it once between them. Nothing can be put in. The chest block can't be broken, blown up, pushed or changed, so it never drops as an item, and it can't be opened as a real chest. Chests left by a crash are removed at the next start.
- No farming competitions. Creative and spectator players never score. Blocks players place are remembered, so place-and-break scores nothing (even when placed before the competition). Spawner, spawn egg, bred, split and built mobs don't count unless turned on.
- Chat games: creative/spectator players can't win, the right answer is hidden from chat, and only one chat game runs at a time so an answer can't count twice. Muted players (chat cancelled by another plugin) can't answer.
- KOTH: creative and spectator players don't count as on the hill.
- Rewards are never lost. Items that don't fit and money that can't be paid go to the claim box. Rewards for someone offline wait in the database. Claim box and waiting rows are deleted before they're handed out, so they can only be claimed once, on any server sharing the database.
- Drop parties only create new items rolled from the table; nothing is taken from anyone.
- Menus are locked: nothing can be taken out of
/eventsor the claim box except by its buttons.
PlaceholderAPI
| Placeholder | Value |
|---|---|
%driftevents_running% | How many events are on now |
%driftevents_running_names% | Their names, comma separated |
%driftevents_next% | The next scheduled event |
%driftevents_next_in% | How long until it starts |
%driftevents_claims% | Rewards waiting in the player's claim box |
%driftevents_competition_score% | The player's score in the running competition |
%driftevents_competition_leader% | Who's leading the running competition |
%driftevents_event_<name>_running% | true or false |
%driftevents_event_<name>_next_in% | How long until that event is next due |
Configuration files
| File | What's in it |
|---|---|
config.yml | Feature switches, settings, the reward line list, storage |
commands.yml | Command names, aliases and permissions |
messages.yml | Every message (MiniMessage), with the prefix and prefix-enabled |
menus.yml | The /events menu and the claim box |
events/koth.yml | KOTH hills |
events/supply-drops.yml | Supply drop tiers and events |
events/drop-parties.yml | Drop parties |
events/chat-games.yml | Chat game events |
events/competitions.yml | Competitions |
loot.yml | Loot tables for supply drops and drop parties |
questions.yml | Words, phrases and trivia for chat games |
Event names must be different across all the event files.
Every file starts with a boxed header saying how to apply changes, is split into sections, and has a note above
every option saying what it does, its unit and the values it takes. Times are written like 30s, 15m or 2h.
When you update, new options are added with their notes and everything you changed is kept. When the notes
themselves change, config.yml, commands.yml, messages.yml and menus.yml are rebuilt once with the new notes
and your values written back in; the old file is kept in data/backups/. Messages you never changed get the new
default wording. The event files, loot.yml and questions.yml are yours and are never rewritten.
Mistakes in the files
A value DriftEvents can't use never stops the plugin. The console says which file and option, what was wrong and what is used instead, for example:
events/koth.yml: events.castle.capture-seconds "three minutes" isn't a whole number, using 180
/driftevents reload tells you how many problems it found, so you know to look.
Folder layout
plugins/DriftEvents/
config.yml settings, starting with the features: switches
messages.yml every message
menus.yml every menu
commands.yml command names, aliases and permissions
events/ one file per kind of event
koth.yml
supply-drops.yml
drop-parties.yml
chat-games.yml
competitions.yml
loot.yml loot tables
questions.yml chat game words and questions
data/ the plugin's own files, no need to open them
database.mv.db the claim box and rewards waiting for players who were offline
active-drops.yml supply drop chests still in the world, removed at the next start after a crash
backups/ old copies of files DriftEvents replaced
*.version which version of each file you have
Older versions kept the database (data.mv.db), active-drops.yml and the version markers next to config.yml,
and the five event files at the top. They are moved into data/ and events/ the first time the new version
starts (one console line per file), and nothing is overwritten or deleted.