Prison Perks
PrisonPerks lets players spend Perk Tickets to roll a random perk onto their PinnaPrison pickaxe. A perk is a set of permanent boosts, such as extra money, tokens or enchant procs, at a level from I to V. The rarer the perk, the harder it is to land.
The short version
Upload the prisonperks jar to your plugins folder and restart the server. The console should say prisonperks enabled (20 perks, ...). Then join as an operator, put your prison pickaxe in your inventory and run:
/pinna reload
/prisonperks tickets give <your name> 5
/perks
/prisonperks info/pinna reloadloads the "Perk:" line that PrisonPerks added to PinnaPrison's pickaxe lore on its first start. You only need to do this once.tickets givegives you five Perk Tickets. Every roll costs one./perksopens the Pickaxe Perks menu. Click Roll a Perk: the ring spins for three seconds, then the perk lands on your pickaxe and the result shows in chat./prisonperks infoshows your perk, its boosts, your tickets and your pity progress. Hold the pickaxe and the boosts apply.
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. Perks boost PinnaPrison's income and enchants, and the menus are PinnaPrison menus. EdLib ships inside PinnaPrison, so don't install it separately. |
| PlaceholderAPI | Optional. Adds the %prisonperks_<key>% placeholders for scoreboards, tab lists and other plugins. The pickaxe lore and PinnaPrison's own variables work without it. |
| Internet on first start | Paper downloads the database drivers the first time the plugin loads. It only needs to do this once. |
| A database | Nothing to set up. Player data goes in an SQLite file by default; MySQL is optional. |
| Permissions | Players can use /perks straight away. The admin commands need op or prisonperks.admin. |
How perks work
Each player has one perk at most. Rolling again replaces it, whatever it was. The perk is saved against the player, not the item, so it stays if their pickaxe is replaced. It shows in the pickaxe lore as a "Perk:" line.
A perk only boosts while the prison pickaxe is in the player's main hand. That's boosts.require-held: true in config.yml. If your players earn a lot without holding the pickaxe, from autominers, robots or the AFK block, set it to false so the perk always counts.
Perk boosts aren't timed boosters. PinnaPrison counts them every time it works out income or enchant chance, so they stack with boosters, crystals and rebirth upgrades. While a perk is active it also shows in PinnaPrison's /boosters menu as a line like "Pickaxe Perk (Fortune Perk V)". Change that wording with booster.name in messages.yml.
Rolling, odds and pity
A roll costs one ticket and needs the player's prison pickaxe somewhere in their inventory. PrisonPerks then picks:
- The perk, weighted by each perk's
chance. Weights are relative: a perk withchance: 5is twice as likely as one with2.5, however many perks there are. - The level, weighted by
roll.level-weightsinconfig.yml. The default[50, 25, 15, 7, 3]gives level I half the time and level V 3% of the time. A perk file can set its ownlevel-weights.
The result is decided before the spin starts, so closing the menu or logging out mid-spin never loses it: the perk is applied straight away. The spin only plays when the roll is made from the menu. Its length and sounds are under roll.animation, and enabled: false makes every roll instant.
Pity luck. Every 500th roll is guaranteed to come from the EPIC tier, which the messages call a "Purple Perk". Its level is rolled as normal. The counter only resets on that guaranteed roll, so landing an Epic perk by luck doesn't reset it. Change the count and the tier under pity: in config.yml.
The bundled perks and their odds:
| Tier | Perks (file names) | Weight each | Real chance each |
|---|---|---|---|
| COMMON | money, tokens, gems, shards, beacons | 12.5 | 13.5% |
| UNCOMMON | goldrush, tycoon, jeweler, climber | 5 | 5.4% |
| RARE | blacksmith, wizard | 2.5 | 2.7% |
| RARE | magnet, greedy, mermaid, banker | 1 | 1.08% |
| EPIC | fortune, power, godly, master | 0.25 | 0.27% |
| LEGENDARY | universal | 0.1 | 0.11% |
/prisonperks list prints the real chance of every loaded perk, so run it after you change anything.
Editing perks
Each perk is one file in plugins/prisonperks/perks/. The file name is the perk's id, which /prisonperks setperk uses. The comment block at the top of money.yml explains every key. Trimmed, the Money Perk looks like this:
display-name: '&a&lMoney Perk'
tier: COMMON
material: EMERALD
chance: 12.5
lore:
- '&8ᴘɪᴄᴋᴀxᴇ ᴘᴇʀᴋ &8• {tier-color}{tier}'
- '{levels}'
- '&7Roll chance: &f{chance}% &8({chance-real}% of all rolls)'
levels:
'1': { lore: ' &a┃ &fI &8» &aMoney &7+5%', boosts: { money: 0.05 } }
'5': { lore: ' &a┃ &fV &8» &aMoney &7+25%', boosts: { money: 0.25 } }tieris COMMON, UNCOMMON, RARE, EPIC or LEGENDARY. It sets the tier name and colour in the lore, the grouping in the index and which perks pity can give. It doesn't change the odds;chancedoes.materialtakes a Bukkit material,player-<name>ortexture-<base64>for a custom head.loreis the text on the perk's icon in the menus.{levels}expands to every level'sloreline.- Each level's
boostssets a bonus per stat as a decimal:0.25is +25%. The level'sloreline is only text, so update it when you change a number.
The boost keys you can use:
| Key | What it boosts |
|---|---|
A PinnaPrison currency id, such as money, tokens, gems, shards, beacons, rankupxp or pickaxexp |
Income of that currency. tool-exp means the same as pickaxexp. |
enchant |
The proc chance of every enchant. |
An enchant id, such as tokengreed |
That enchant's proc chance only. |
blocks |
The blocks / autosell multiplier. |
armor-xp |
The XP worn armour gains. |
A key PinnaPrison doesn't recognise does nothing, and the console warns about it at startup and on reload.
To add a perk, copy a file, rename it (the new name is the id), edit it and run /prisonperks reload. To remove one, delete the file or rename it so it no longer ends in .yml. Anyone who had it loses its boosts. Setting chance: 0 doesn't remove a perk: it's treated as 1.
The 20 bundled perks are only written when the perks folder doesn't exist, so a perk you delete stays deleted. To get them all back, delete the whole folder and run /prisonperks reload.
Perk Tickets
Tickets are the only way to roll. New players start with tickets.starting from config.yml (0 by default). Changing it later doesn't affect players who've already joined. There are three ways to hand tickets out:
- The ticket store in
/perks. Three buttons sell 1, 10 and 25 tickets for 5,000, 45,000 and 100,000 tokens. Change them inplugins/PinnaPrison/guis/prisonperks/tool-perks.yml, then run/pinna reload:yamlbuy-1: custom-item: type: 'perks-buy-tickets' amount: 1 cost: 5000 currency: 'tokens'currencycan be any PinnaPrison currency id. Theamount:outsidecustom-itemonly sets the stack size of the icon. - A console command, for crates, votes or anything else that runs commands:
prisonperks tickets give <player> 5 -s. It works for offline players who've joined before. - The PinnaPrison currency
perktickets. Anywhere PinnaPrison takes actions,give-eco perktickets 5gives five tickets. The PrisonPass rewardsperk-tickets-1,perk-tickets-3andperk-tickets-5already use it.
So PinnaPrison shows a proper name instead of perktickets, add this to plugins/PinnaPrison/external-currencies.yml:
currencies:
perktickets:
display-name: 'Perk Tickets'
color:
primary: '&d'
secondary: '&5'The menus
/perks opens Pickaxe Perks: pity progress at the top, a Perk Index button, the player's pickaxe in the middle with the spin ring around it, the Roll button and the ticket store. PinnaPrison's token and gem enchant menus already have a PERKS button that runs /perks. On its first start PrisonPerks changes that button's lore from "sword perks" to "pickaxe perks". Closing Pickaxe Perks takes players back to the token enchant menu; change or blank main-menu: 'token-enchants' in tool-perks.yml to change that.
Perk Index (/perks index, or the book in Pickaxe Perks) lists every perk grouped by tier, with its levels and boosts. The perk the player has glows and shows its level.
Both are PinnaPrison menu files, so you edit them like any other PinnaPrison menu. The comment block at the top of tool-perks.yml lists the PrisonPerks item types and the {tokens} you can use.
Commands
Player commands:
| Command | Permission | What it does |
|---|---|---|
/perks (also /toolperks, /pickaxeperks) |
prisonperks.use |
Opens the Pickaxe Perks menu. |
/perks index |
prisonperks.use |
Opens the Perk Index. |
Admin commands (alias /pperks):
| Command | Permission | What it does |
|---|---|---|
/prisonperks help |
prisonperks.admin |
Lists the admin commands. /prisonperks on its own does the same. |
/prisonperks reload |
prisonperks.admin |
Reloads config.yml, messages.yml and the perk files. Any roll in progress is finished first. |
/prisonperks open [player] |
prisonperks.admin |
Opens Pickaxe Perks for an online player, or for you. |
/prisonperks tickets <player> |
prisonperks.admin |
Shows a player's ticket balance. |
/prisonperks tickets give|take|set <player> <amount> |
prisonperks.admin |
Changes a player's tickets. take stops at 0. |
/prisonperks setperk <player> <perk> [level] |
prisonperks.admin |
Puts a perk on a player's pickaxe, by perk id. Without a level it uses the perk's highest. |
/prisonperks removeperk [player] |
prisonperks.admin |
Removes a player's perk. |
/prisonperks roll [player] |
prisonperks.admin |
A free roll for an online player. It needs no ticket, but it still counts towards pity and needs the pickaxe in their inventory. |
/prisonperks info [player] |
prisonperks.admin |
Shows a player's perk, boosts, tickets, total rolls and pity progress. |
/prisonperks list |
prisonperks.admin |
Lists every loaded perk with its tier, weight, real chance and number of levels. |
tickets, setperk, removeperk and info also work on offline players who've joined before. Add -s as the last argument to run a command without sending you any feedback, for example /prisonperks tickets give Steve 5 -s. The player still gets their own message, such as "You received 5 Perk Tickets".
Permissions
| Permission | Default | What it gives |
|---|---|---|
prisonperks.use |
Everyone | /perks and the perk menus. |
prisonperks.admin |
Op | Every /prisonperks command. |
prisonperks.* |
Op | Both of the above. |
Files
| File | What you'd edit it for | How changes apply |
|---|---|---|
plugins/prisonperks/config.yml |
Starting tickets, level weights, the spin and its sounds, pity, boosts.require-held, the no-perk text and pity bar, the database and the PinnaPrison hooks. |
/prisonperks reload, except storage, hooks.pinnaprison.external-currency and hooks.placeholderapi.edperks-compat, which need a restart. |
plugins/prisonperks/messages.yml |
Every chat message, the roll result, the /boosters line (booster.name) and the names of the enchant, blocks and armor-xp stats. Blank a message ('') to turn it off. |
/prisonperks reload |
plugins/prisonperks/perks/<id>.yml |
One file per perk: its name, tier, icon, weight, levels and boosts. | /prisonperks reload |
plugins/prisonperks/perks.db |
The SQLite database: each player's perk, tickets, rolls and pity progress. Don't edit it. Back it up together with the perks.db-wal and perks.db-shm files next to it. |
Not used with MySQL. |
plugins/prisonperks/.pickaxe-lore-patched |
A marker showing the one-time pickaxe lore patch has run. Delete it to run the patch again. | Restart |
plugins/PinnaPrison/guis/prisonperks/tool-perks.yml |
The Pickaxe Perks menu, including the ticket store prices. | /pinna reload |
plugins/PinnaPrison/guis/prisonperks/perk-index.yml |
The Perk Index layout. | /pinna reload |
PrisonPerks writes the two menu files at startup only if they're missing, and never overwrites them, so your edits are safe. To get a default back, delete the file and restart; /pinna reload alone won't bring it back.
On its first start PrisonPerks also edits three PinnaPrison files once: it adds the perk line to plugins/PinnaPrison/pickaxe/config.yml and rewords the PERKS button in guis/token-enchants.yml and guis/gem-enchants.yml. It keeps a copy of each original, ending in .prisonperks.bak. Set hooks.pinnaprison.pickaxe-lore.auto-patch: false before the first start if you'd rather make these changes yourself.
Placeholders
PinnaPrison's own variables need no extra plugin and work in the pickaxe lore and PinnaPrison menus and messages: %pinnaprison_variable_perk_<key>%, plus %pinnaprison_variable_perk% for the current perk. With PlaceholderAPI the same values are %prisonperks_<key>%.
| Key | What it shows |
|---|---|
current_perk |
The perk and level, such as "Money Perk III", or placeholders.no-perk ("None") from config.yml. |
current_perk_name |
The perk name only, or the no-perk text. |
current_perk_id |
The perk id, or blank. |
current_perk_level |
The level as a number, or 0. |
current_perk_roman |
The level as I to V, or blank. |
current_perk_tier |
Common, Uncommon, Rare, Epic or Legendary, or blank. |
current_perk_details |
Every boost of the perk, such as "Money +25%". |
has_perk |
true or false. |
tickets |
The player's Perk Tickets. |
total_rolls |
How many times the player has rolled. |
rolls_until_pity |
Rolls counted towards pity so far. Despite the name, it counts up. |
pity_remaining |
Rolls left until the guaranteed roll. |
pity_max |
pity.rolls from config.yml. |
pity_bar |
A progress bar, styled under placeholders.pity-bar. |
perk_boost_<stat> |
The player's current bonus for a boost key as a decimal, such as 0.250. |
perk_boost_percent_<stat> |
The same bonus as a percentage, such as 25. |
For the boost keys the PinnaPrison form is %pinnaprison_variable_perk_boost_money%, without a second perk_, and it only exists for keys at least one perk uses. Write tool-exp as pickaxexp here. Values are only filled in for online players; offline players show 0 or blank.
With PlaceholderAPI installed and EdPerks not installed, %edperks_<key>% returns the same values, so scoreboard lines written for EdPerks keep working. Turn this off with hooks.placeholderapi.edperks-compat: false.
Troubleshooting
The pickaxe lore doesn't show a "Perk:" line.
Run /pinna reload after the first start. If it's still missing, check the console from that start. If it says it "Could not find where to insert the perk line", add the line from hooks.pinnaprison.pickaxe-lore.line to the lore in plugins/PinnaPrison/pickaxe/config.yml yourself. To make PrisonPerks try again, delete plugins/prisonperks/.pickaxe-lore-patched and restart.
"You must be holding your prison pickaxe to roll a perk!" PrisonPerks couldn't find the player's PinnaPrison pickaxe anywhere in their inventory. An ordinary pickaxe doesn't count. Get the prison pickaxe back into their inventory and roll again.
A player has a perk but earns no more than before.
By default the perk only boosts while the prison pickaxe is in their main hand. If most of their income comes from autominers or other things that run while they hold something else, set boosts.require-held: false and run /prisonperks reload. Also check the console for "which is neither a PinnaPrison currency nor an enchant": that perk uses a boost key your server doesn't have, so fix the key in its file.
give-eco perktickets does nothing, or tickets show as "perktickets".
The console should say "Registered Perk Tickets as PinnaPrison currency 'perktickets'" at startup. If it doesn't, set hooks.pinnaprison.external-currency: true and restart; a reload won't change it. For a proper name, add the external-currencies.yml entry from Perk Tickets.
/perks says "The perks menu isn't loaded".
tool-perks.yml is missing from plugins/PinnaPrison/guis/prisonperks/. Restart the server and PrisonPerks writes the default again.
A perk you added or edited doesn't show up.
Run /prisonperks reload, then check the console. A YAML mistake ("could not be read") or a file with no levels ("no 'levels' defined") means the perk is skipped. An unknown tier falls back to COMMON. Run /prisonperks list to see what loaded.
Last updated