SeasonForge logoSeasonForge

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: true

The key (money, shop-points, gems) is the currency id used everywhere else.

typeWorks withNeeds
VAULTYour Vault economy pluginVault and an economy plugin
PLAYERPOINTSPlayerPointsPlayerPoints
COMMANDAny other currency: the balance is read from a placeholder, and it is taken and given with console commandsPlaceholderAPI, for the balance
KeyWhat it doesDefault
displayHow an amount is shown. %amount% is the number, with thousands separators.%amount%
whole-numbersShow amounts without decimalstrue, except false for VAULT
balance-placeholderCOMMAND only. PlaceholderAPI placeholder returning the player's balance. Anything that is not a digit is stripped, so 1,250 Gems reads as 1250.
take-commandCOMMAND only. Console command that takes %amount% from %player%
give-commandCOMMAND 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 error sound.
  • 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.

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
KeyWhat it doesDefault
slotSlot in the shop menu. Leave it out to fill the menu's item-slots in order.flows into item-slots
pageWhich page a fixed slot is on1
displayItem 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
priceAmount charged0
currencyCurrency id from currencies.ymlmoney
giveWhat the purchase gives, see below
limit.amountHow many times one player can buy it. Leave limit out for no limit.no limit
limit.resetWhen the count starts over: DAILY, WEEKLY, MONTHLY, SEASONAL or NONESEASONAL
confirmGo through the confirm menu firsttrue
purchase-soundSound key played after buyingpurchase

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:

KeyWhat it gives
battlepass-xpBattle Pass XP, with the usual roll over into the next levels
battlepass-levelsWhole 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

A shop click runs four checks, then the confirm menu when confirm is true, then takes the currency, saves the purchase and gives the reward. A failed check refuses with nothing taken, and a failed save refunds the payment.

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.

On this page