Prison Events
PrisonEvents runs timed events on your prison server. Players race to mine the most blocks, earn the most currency or reach a shared goal together, and the plugin pays rewards to the winners and to everyone who took part. Events start on their own on a timer, or you can start them by hand.
The short version
Upload the PrisonEvents jar to your plugins folder and restart the server. Then, as an operator, run:
/events list
/events start mining-frenzy 2m
/events
/events top
/events stop mining-frenzy
/events next/events listshows every event that loaded, with its id. Out of the box that'scommunity-mine,mining-frenzy,ore-rushandrace-to-1000./events start mining-frenzy 2mstarts Mining Frenzy for two minutes instead of its usual ten. Everyone online gets a start message and title, and a boss bar and action bar appear. Now mine a few blocks in a PinnaPrison mine./eventsshows the time left, your score, your position and the leader./events topshows the leaderboard./events stop mining-frenzyends the event now. Rewards are still paid when you stop an event by hand, so you'll see the winner announcement and get the first-place reward./events nextshows which event the scheduler will start next, and when. By default a random event starts every 45 minutes to 1 hour 15 minutes.
What you need
| Requirement | Details |
|---|---|
| Paper 26.1.1 | The server software the set-up is built for, running on Java 25. |
| PinnaPrison 1.2.25 | Required. PrisonEvents counts mining and earnings through PinnaPrison and pays rewards in PinnaPrison currencies. EdLib ships inside PinnaPrison, so don't install it separately. |
| PlaceholderAPI | Optional. Adds the %prisonevents_...% placeholders and lets you use other plugins' placeholders in PrisonEvents messages. |
| Internet access on first start | Paper downloads the H2 and HikariCP database libraries the first time PrisonEvents loads. |
| Permissions | Admin commands are for operators by default. Players can use everything else without any setup. |
How an event works
Every event is one file in plugins/PrisonEvents/events/. The file name is the event's id, so ore-rush.yml is the event ore-rush. You can sort files into subfolders; the id is still the file name.
An event's type decides how it's won:
| Type | How it works |
|---|---|
LEADERBOARD |
Runs for its full duration and the highest score wins. This is the default. |
FIRST_TO_GOAL |
The first player to reach objective.goal wins, and the event ends straight away. |
COMMUNITY |
Everyone adds to one shared total. The main rewards depend on the server reaching objective.goal before time runs out. |
Its objective.type decides what counts as score:
| Objective | What counts |
|---|---|
BLOCKS_MINED |
Blocks mined by hand in PinnaPrison mines. Blocks broken by enchants, bombs, drills and autominers count only when the event has count-enchant-blocks: true. |
CURRENCY_EARNED |
Currency a player earns through PinnaPrison while online, such as mining payouts and sales. PrisonEvents' own rewards never count. |
CUSTOM |
Nothing counts automatically. Score only comes from /events progress, for example from a vote plugin's reward command. |
An event doesn't change what players earn while it runs. It keeps score, then pays rewards when it ends. The set-up comes with six events:
| Event | Type | Counts | Length | Notes |
|---|---|---|---|---|
mining-frenzy |
LEADERBOARD |
Blocks | 10m | Top three get tokens. Picked a little more often by the scheduler. |
ore-rush |
LEADERBOARD |
Ores | 8m | Only blocks matching *_ORE or ANCIENT_DEBRIS count. |
race-to-1000 |
FIRST_TO_GOAL |
Blocks | 15m | First to 1,000 blocks wins. |
community-mine |
COMMUNITY |
Blocks | 20m | Shared goal of 250,000 blocks. Enchant blocks count. |
money-maker |
LEADERBOARD |
Currency | 10m | Turned off until you set its currency. |
vote-party |
COMMUNITY |
Votes | 1h | Turned off. Fed by /events progress and never scheduled. |
Adding or changing an event
Anything an event file doesn't set comes from event-defaults at the bottom of config.yml. Change a key there to change every event; set the same key in one event file to change only that event.
To add an event, copy a file in events/, rename it (the new name is the id), edit it and run /events reload. Here's mining-frenzy.yml, trimmed:
name: "&6&lMining Frenzy"
description: ["&7Mine as many blocks as you can!"]
duration: 10m
type: LEADERBOARD
objective:
type: BLOCKS_MINED
name: "Blocks"
milestones: [1000, 5000, 10000, 25000]
rewards:
placements:
1:
- "[GIVE-ECO] tokens 25k"
- "[FIREWORK] GOLD YELLOW"
2: ["[GIVE-ECO] tokens 10k"]
3: ["[GIVE-ECO] tokens 5k"]nameanddescriptiontake colour codes:&aand&#RRGGBB.objective.nameis the word shown after scores, such as "Blocks".durationtakes90s,5m,1h30mor2d.objective.goalis the target forFIRST_TO_GOALandCOMMUNITYevents. On aLEADERBOARDevent it only feeds the progress bars and percentages.milestonesare scores that trigger a message. In aCOMMUNITYevent everyone hears when the shared total passes one; in other events each player gets a private message when their own score does.permissionlimits scoring to players with that permission node, andenabled: falsekeeps the file but doesn't load the event.
To narrow down what counts, use the keys under objective.filter. All of them are optional:
| Key | What it does |
|---|---|
blocks |
Only these blocks count, such as ["*_ORE", "ANCIENT_DEBRIS"]. * is a wildcard. |
worlds |
Only progress made in these worlds counts. |
currencies |
For CURRENCY_EARNED: only these PinnaPrison currency ids count. |
permission |
Only players with this permission score. |
multiplier |
Every gain is multiplied by this before it's added to the score. |
min-amount |
Gains smaller than this are ignored. |
require-host-tool |
true counts progress only while the player holds their PinnaPrison pickaxe. |
A blocks filter stops enchant, bomb, drill and autominer blocks counting, even with count-enchant-blocks: true, because those breaks don't report which blocks they were.
Scheduling events
The scheduler section of config.yml starts events on its own:
scheduler:
enabled: true
mode: INTERVAL # INTERVAL (random event every interval-min..interval-max) or TIMES
interval-min: 45m
interval-max: 1h15m
times: ["12:00", "18:00", "21:00"] # TIMES mode, HH:mm
timezone: system # e.g. Europe/London
min-players: 1 # online players required (events may require more)
retry-interval: 5m # when an event cannot start, try again after this
avoid-repeat: true # never pick the same event twice in a row
announce-before: [300, 60, 10] # seconds before the start: messages.yml -> scheduler.starting-soon
events: [] # only pick from these ids (empty = every event with scheduler.enabled: true)In INTERVAL mode the wait is a random time between interval-min and interval-max, counted from when the last automatic event started (or from server start). In TIMES mode an event starts at each listed time; if times is empty, the scheduler falls back to INTERVAL. If an event can't start when it's due, the scheduler tries again after retry-interval.
The scheduler picks at random from the eligible events, using each event's own scheduler section (enabled: true, weight: 10, min-players: 1 and cooldown: 0s in event-defaults). A higher weight makes an event more likely to be picked. enabled: false or weight: 0 keeps it out of the schedule, but you can still start it with /events start. min-players is how many players must be online for this event, and cooldown is how long after the scheduler last started it before it can be picked again.
/events pause stops the countdown until /events resume. A pause lasts until you resume or restart the server. /events reload and a restart both reset the countdown to the next automatic event.
Rewards
Rewards are lists of actions under rewards in an event file or in event-defaults:
| Group | Who gets it |
|---|---|
placements |
The player in each listed position (1, 2, 3 and so on). |
participation |
Everyone who scored at least min-progress, winners included. |
community |
COMMUNITY events only, when the goal is reached: everyone who scored at least participation.min-progress. |
losers |
Everyone who scored but didn't get a placement reward. |
everyone |
Every player online when the event ends, whether they took part or not. |
event-defaults gives 500 tokens to anyone who scores at least 100. Every bundled event keeps that participation reward except Community Mine and Vote Party, which turn it off with actions: [].
Rewards aren't paid when an event is cancelled by /events reload or a restart, or when you stop it with /events stop and rewards-on-manual-stop is false. If a COMMUNITY event misses its goal, placements and community rewards are skipped; set community-placements-when-failed: true in config.yml to pay placements anyway.
offline-rewards decides what happens to players who left before the end. queue (the default) saves their rewards and gives them when they next join. true pays now, but only currency, console and broadcast actions work for an offline player. false skips them.
| Action | What it does |
|---|---|
[GIVE-ECO] <currency> <amount> |
Gives a PinnaPrison currency, such as tokens 25k. The exact amount; boosters don't apply. [TAKE-ECO] takes it. |
[CONSOLE] <command> |
Runs a command as the console. [PLAYER] makes the player run it. |
[MESSAGE] <text> |
Messages the player. [CENTER] centres it; [BROADCAST] and [BROADCAST-CENTER] send it to everyone. |
[TITLE] <text> |
Shows a title. Separate the title, subtitle, fade-in, stay and fade-out (ticks) with vertical bars. [BROADCAST-TITLE] shows it to everyone. |
[ACTIONBAR] <text> |
Shows an action bar message. [BROADCAST-ACTIONBAR] shows it to everyone. |
[SOUND] <sound> [volume] [pitch] |
Plays a sound. [BROADCAST-SOUND] plays it to everyone. |
[GIVE-ITEM] <material> [amount] [name] |
Gives an item, dropping it at the player's feet if their inventory is full. |
[EFFECT] <effect> [seconds] [level] |
Gives a potion effect, 30 seconds at level 1 unless you say otherwise. |
[FIREWORK] [colours], [LIGHTNING] |
A visual effect only that player sees. It does no damage. |
[HOST] <action> |
Runs one of PinnaPrison's own action strings. |
[PERMISSION] <node> <action> |
Runs the action only if the player has the permission. |
[CHANCE] <percent>, [DELAY] <seconds> |
CHANCE runs the next action only with this chance. DELAY waits before running the rest of the list. |
Placeholders such as {player}, {event}, {position} and {value_formatted} work in actions. To give crate keys, use [CONSOLE] prisoncrates give {player} <crate> <amount> (see PrisonCrates).
What players see
Each event file (or event-defaults) controls the displays:
- Boss bar (
bossbar): thetext,colorandstyle, and what the bar shows withprogress:TIMEdrains as time runs out,TIME_ELAPSEDfills,GOALshows the shared total (or the leader's score) against the goal, andPLAYERshows the player's own progress. It flashesflash-colorin the lastflash-seconds. - Action bar (
actionbar): added after PinnaPrison's own action bar text, using theactionbar.addon-separatorfrom PinnaPrison'sdisplay.yml, and shown alone when PinnaPrison has nothing to show. - Chat, titles and sounds (
messages,titles,sounds): start, countdown (at each second incountdown-at), milestones, end, no winner, cancelled, goal reached, community goal failed, andjoin-infofor players who join mid-event. An empty string turns one off. - Winner announcement (
winner-announcement): the topplacementsplayers are announced in chat. Every line containing{head}gets one row of the winner's face. Faces of offline players come from Mojang's servers (thechat-headsection ofconfig.yml); if one can't be fetched, Steve is drawn instead.
Players can hide these with /events toggle bossbar, actionbar, messages or all. Turning off messages also hides event titles and sounds. The choice is saved.
Commands
The main command is /prisonevents, with the aliases /events, /ev, /prisonevent and /miningevents. Players can use these:
| Command | Permission | What it does |
|---|---|---|
/events |
None | Shows the running event's time left, your score and the leader, or when the next event starts. |
/events help |
None | Lists the commands. Admin commands only show if you can use one. |
/events list |
None | Lists every loaded event with its id, type, objective and length, and marks the running ones. |
/events info [event] |
None | Details of a running event. Leave out the id to use the first running event. |
/events top [event] [page] |
None | The leaderboard of a running event, 10 entries per page (leaderboard.per-page). |
/events next |
None | The next automatic event and how long until it starts. |
/events stats [player] |
None for yourself; prisonevents.stats.others for others |
Wins, top-three finishes, events played, best score, lifetime total and last win. |
/events toggle [display] |
prisonevents.toggle |
Hides or shows bossbar, actionbar, messages or all (the default). |
Admin commands:
| Command | Permission | What it does |
|---|---|---|
/events start <event> [duration] |
prisonevents.command.start |
Starts an event now. The duration, such as 5m, replaces the one in the file. |
/events stop [event] |
prisonevents.command.stop |
Ends a running event now. With no event, or all, it ends every running event. |
/events extend <time> [event] |
prisonevents.command.extend |
Adds time to a running event. |
/events skip |
prisonevents.command.skip |
Starts the next automatic event straight away. It fails while another event is running, unless max-concurrent-events allows more. |
/events pause, /events resume |
prisonevents.command.pause |
Pauses or resumes the scheduler. Running events carry on. |
/events progress <player> <event> <amount> |
prisonevents.command.progress |
Adds score to a player in a running event, ignoring filters. Amounts such as 1.5k work. |
/events setprogress <player> <event> <amount> |
prisonevents.command.progress |
Sets a player's score in a running event. |
/events reload |
prisonevents.command.reload |
Reloads config.yml, messages.yml and every event file. Cancels running events. |
Permissions
| Permission | Default | What it gives |
|---|---|---|
prisonevents.admin |
Operators | Every admin command and /events stats <player>. |
prisonevents.command.start |
Operators | /events start |
prisonevents.command.stop |
Operators | /events stop |
prisonevents.command.extend |
Operators | /events extend |
prisonevents.command.skip |
Operators | /events skip |
prisonevents.command.pause |
Operators | /events pause and /events resume |
prisonevents.command.progress |
Operators | /events progress and /events setprogress |
prisonevents.command.reload |
Operators | /events reload |
prisonevents.toggle |
Everyone | /events toggle |
prisonevents.stats.others |
Operators | /events stats <player> for other players |
The permission keys in event files take any node you choose; give it to players with your permissions plugin.
Files
| File | What you'd edit it for |
|---|---|
plugins/PrisonEvents/config.yml |
The scheduler, event-defaults, time and number formats, progress bars, chat heads, storage. |
plugins/PrisonEvents/messages.yml |
Command replies, the help text, the "starts in" warning, the queued-reward message and placeholder fallbacks. Event messages live in the event files instead. |
plugins/PrisonEvents/events/*.yml |
One file per event: its type, objective, schedule, displays and rewards. |
plugins/PrisonEvents/data/prisonevents.mv.db |
The database of player stats, display toggles, queued rewards and event history. Don't edit it. |
/events reload applies changes to all three kinds of YAML file, except the storage section of config.yml, which needs a restart. The six example events are only written when the events folder doesn't exist, so a deleted example doesn't come back. To get them all back, rename the folder, run /events reload, then move your own event files back. PrisonEvents has no menus.
Placeholders
These need PlaceholderAPI:
| Placeholder | What it shows |
|---|---|
%prisonevents_active%, %prisonevents_active_count% |
Whether an event is running, and how many. |
%prisonevents_next_event%, %prisonevents_next_in%, %prisonevents_next_in_short% |
The next automatic event and the time until it starts. |
%prisonevents_scheduler_enabled% |
true when the scheduler is on and not paused. |
%prisonevents_actionbar% |
The player's event action bar text. |
%prisonevents_<key>% |
Any {key} below for the first running event, such as %prisonevents_time_left% or %prisonevents_top_1_name%. Shows placeholders.not-active from messages.yml when nothing's running. |
%prisonevents_event_<id>_<key>% |
The same for one event, such as %prisonevents_event_ore-rush_time_left%. |
%prisonevents_info_<id>_<field>% |
An event's name, duration, type, objective, goal or active, running or not. |
%prisonevents_stats_<field>% |
The player's wins, top3, played, best_formatted, best_event, total_formatted, last_win_event or last_win_ago. |
%prisonevents_last_<field>% |
The last finished event's winner, event, value_formatted, participants or ago. %prisonevents_history_2_<field>% goes one further back, and so on. |
Inside event files, and as <key> above, you can use {event}, {description}, {objective}, {duration}, {time_left}, {time_left_short}, {goal_formatted}, {total_formatted}, {percent}, {bar}, {time_bar}, {participants}, {leader_name}, {leader_value_formatted}, {top_1_name} and {top_1_value_formatted} (up to leaderboard-size, 10 by default). For the player there's {player}, {progress_formatted}, {position}, {position_suffix}, {player_percent}, {player_bar}, {remaining_formatted} and {behind_leader_formatted}. Rewards and winner lines add {value_formatted} (the player's final score), and placement rewards and winner lines also have {winner}. Formatted numbers use PinnaPrison's number format, so they match the rest of your server.
Troubleshooting
No events start on their own.
Run /events next. If automatic events are disabled, set scheduler.enabled: true and run /events reload; if they're paused, run /events resume. Otherwise check that enough players are online for scheduler.min-players and the events' own min-players, that no event is still running, and that scheduler.events (if you filled it in) lists real ids.
Winners didn't get their rewards.
Look in the console for Unknown currency or Invalid amount warnings: the currency in [GIVE-ECO] must match a currency id from PinnaPrison's currencies folder. Events cancelled by a reload or restart pay nothing, and a COMMUNITY event that missed its goal skips placements. Players who were offline get queued rewards when they next join.
Enchant, bomb or autominer blocks don't count.
Set objective.count-enchant-blocks: true in the event file. Only Community Mine has it on out of the box. Events with a blocks filter, like Ore Rush, never count these blocks.
An event is missing from /events list.
Check the console after /events reload. Could not load events/... means a YAML mistake, and Duplicate event id means two files share a name in different subfolders. Files with enabled: false, like Money Maker and Vote Party, are skipped on purpose. To use Money Maker, set objective.filter.currencies to the currency id players earn, remove enabled: false and reload. Only earnings made while the player is online count.
Vote Party doesn't give keys.
The bundled reward line [CONSOLE] crate givekey {player} vote 1 isn't a PrisonCrates command. Change it to [CONSOLE] prisoncrates give {player} <crate> 1, using a crate id from plugins/PrisonCrates/crates/. Vote Party also ships turned off, so remove the top-level enabled: false from vote-party.yml and run /events reload. Votes only count while the event runs, so start it with /events start vote-party and have your vote plugin run events progress <player> vote-party 1. While it runs (an hour by default), no automatic event starts.
Last updated