Shop and currencies
Selling levels, XP and items in the Battle Pass shop, purchase limits, and setting up Vault, PlayerPoints and command currencies.
The Battle Pass shop lets players spend a currency on levels, XP, items or anything a command can give. Each season has its own shop.yml, and every price is in a currency from currencies.yml, so one shop can mix money, points and any other currency your server has.
Currencies
plugins/SeasonForge/currencies.yml lists every currency the shop, the premium menu and rewards can use:
currencies-version: 1
currencies:
money:
type: VAULT
display: "<#7fd18b>$%amount%"
shop-points:
type: PLAYERPOINTS
display: "<#6fb7f2>%amount% Shop Points"
gems:
type: COMMAND
balance-placeholder: "%gems_balance%"
take-command: "gems take %player% %amount%"
give-command: "gems give %player% %amount%"
display: "<#c58cf2>%amount% Gems"
whole-numbers: trueThe key (money, shop-points, gems) is the currency id used everywhere else.
type | Works with | Needs |
|---|---|---|
VAULT | Your Vault economy plugin | Vault and an economy plugin |
PLAYERPOINTS | PlayerPoints | PlayerPoints |
COMMAND | Any other currency: the balance is read from a placeholder, and it is taken and given with console commands | PlaceholderAPI, for the balance |
| Key | What it does | Default |
|---|---|---|
display | How an amount is shown. %amount% is the number, with thousands separators. | %amount% |
whole-numbers | Show amounts without decimals | true, except false for VAULT |
balance-placeholder | COMMAND only. PlaceholderAPI placeholder returning the player's balance. Anything that is not a digit is stripped, so 1,250 Gems reads as 1250. | |
take-command | COMMAND only. Console command that takes %amount% from %player% | |
give-command | COMMAND only. Console command that gives it |
- The balance is always checked before anything is taken. Too little refuses the purchase with a message and the
errorsound. - If a currency's plugin is not installed, anything priced in it says the currency is not available, and rewards in it are skipped with a console warning.
- PlayerPoints only holds whole points: prices round up and rewards round to the nearest point.
The bundled shop-points currency is PlayerPoints. If your "Shop Points" come from another plugin, change its type, or make it a COMMAND currency pointed at that plugin.
Shop items
Each season has a shop.yml:
season-version: 1
items:
plus_one_level:
slot: 11
display:
material: EXPERIENCE_BOTTLE
name: "<#f2b544><bold>+1 Battle Pass Level"
lore:
- "<#c9c9c9>Jump straight to the next level."
price: 500
currency: shop-points
give:
battlepass-levels: 1
limit:
amount: 10
reset: SEASONAL
confirm: true
purchase-sound: purchase-xp| Key | What it does | Default |
|---|---|---|
slot | Slot in the shop menu. Leave it out to fill the menu's item-slots in order. | flows into item-slots |
page | Which page a fixed slot is on | 1 |
display | Item shown in the shop, with the usual item keys (material, itemsadder, amount, name, lore, glow and so on). The price lines from the menu are added under its lore. | a chest |
price | Amount charged | 0 |
currency | Currency id from currencies.yml | money |
give | What the purchase gives, see below | |
limit.amount | How many times one player can buy it. Leave limit out for no limit. | no limit |
limit.reset | When the count starts over: DAILY, WEEKLY, MONTHLY, SEASONAL or NONE | SEASONAL |
confirm | Go through the confirm menu first | true |
purchase-sound | Sound key played after buying | purchase |
What give takes
give takes every reward type from Levels and rewards (items, commands, money, currency, messages and the rest), plus two for the pass itself:
| Key | What it gives |
|---|---|
battlepass-xp | Battle Pass XP, with the usual roll over into the next levels |
battlepass-levels | Whole levels. The player lands at the start of the new level with 0 XP into it, and never past max level. |
A player at max level cannot buy an item that gives battlepass-xp or battlepass-levels: they get the "already at the max level" message and nothing is taken.
Limits
The limit is per player, and limit.reset uses the same reset times as quests. The shop shows "Bought: 2/10 (Seasonal)" from item-lore.limit-lines, and "Limit reached" once it is used up. The %battlepass_shop_<id>_purchases%, _limit and _remaining placeholders show the same numbers anywhere.
How a purchase goes
The purchase is saved in the database before the reward is given, just like a claim. If saving fails, or the player logs off before it finishes, the currency is given back.
The bundled shop
Season 1 sells +1, +5 and +10 levels and 5,000 XP for Shop Points, 1,000 XP and 8 golden apples for money, and 30 minutes of night vision as an example command reward. Change the prices and limits to fit your economy.
/battlepass shop needs battlepass.shop, which every player has by default.