MIRAWIKI
ESC
↑ ↓ NavigateEnter OpenESC Close

Economy

Mira comes with a complete server economy: accounts, transfers, admin management and a leaderboard. Chest shops and jobs book directly through these accounts. Every transaction is persisted immediately and protected against concurrent bookings.

Commands #

Commands8
CommandSyntaxPermissionDefaultDescription
/balance/balance [player] (alias /bal, /money)economy.balancetrueShow balance; other players: economy.balance.others (true, offline too)
/pay/pay <player> <amount>economy.paytrueTransfers money to an online player
/baltop/baltop [page] (alias /balancetop, /moneytop)economy.baltoptrueLeaderboard of the richest players
/eco give/eco give <player> <amount>economy.adminopCredits money (offline too)
/eco take/eco take <player> <amount>economy.adminopWithdraws money
/eco set/eco set <player> <amount>economy.adminopSets the balance exactly
/eco reset/eco reset <player>economy.adminopResets to the starting balance
/eco reload/eco reloadeconomy.adminopReloads the economy config and messages (balances are not re-read)

Tip: Amounts accept comma and dot as decimal separator plus the suffixes k and M: 1.5k = 1500. Invalid values (negative, NaN, infinite) are rejected everywhere.

/pay <player> <amount> requires the exact player name. A name prefix (e.g. Alex for Alexander) is not completed but rejected as "player not online". Vanished players count as offline for everyone without mod.vanish.see (same rule as /msg). /eco give|take|set|reset also resolves the name exactly: an online player with exactly that name first, otherwise an offline player known to the server.

/eco reload only reloads the economy configuration and the messages. Balances are not re-read, because the running server keeps the accounts and writes the stored data in the background. Manual edits of stored balances therefore only take effect after a restart.

Note: The leaderboard is cached for up to 30 seconds, so a record freshly set via /eco set does not appear in /baltop immediately. Ranks 1 to 3 are highlighted with 🥇/🥈/🥉.

Vault: your own or a foreign economy #

Mira works with Vault in both directions. The switch is economy.internal in config.yml:

  • internal: true (default): Mira uses its own economy and registers it as the Vault economy. Other plugins (shops, quests, job rewards) then operate on the same accounts.
  • internal: false: Mira uses the economy of another plugin through Vault (for example EssentialsX). All money features then run through it. Without a found economy plugin the internal economy stays active as a fallback (warning in the log). /baltop is technically not available in that mode.

Changing economy.internal requires a restart. On Folia the official Vault currently does not load, so the internal economy automatically stays active there.

Third-party plugins booking 0.00 through Vault (or a fraction that rounds to 0.00) get a success response with an unchanged balance, as with the common economy providers. Negative amounts remain a failure.

Diamond bank instead of the job economy #

With economy.mode: diamonds the server runs a diamond bank instead of the job economy: money is real diamonds, deposited and withdrawn with /bank. Switching needs a restart.

Commands4
CommandSyntaxPermissionDefaultDescription
/bank/bank (alias /diamondbank)bank.usetrueBank menu: balance, deposit (all, 1, 9, 64, any number), withdraw (diamonds or blocks)
/bank deposit/bank deposit [amount|all]bank.deposittrueDeposits diamonds; diamond blocks count 9 and are never split
/bank withdraw/bank withdraw <amount> [blocks]bank.withdrawtrueWithdraws diamonds or diamond blocks; what does not fit into the inventory stays on the account
/bank balance/bank balancebank.usetrueBalance

How it works:

  • Everything in diamonds: balances, /pay, /baltop, shops, team bank, teleport costs, upgrades, claim blocks, warps, PlaceholderAPI, Vault and the web panel use diamonds (two decimals, e.g. 0.04 diamonds per team claim block). Only whole diamonds can be withdrawn.
  • Jobs are off: /jobs, job quests and the job shop do not exist in diamond mode.
  • Stored apart: coin and diamond balances, team banks and shop prices are kept separately. Switching back to jobs finds everything as it was. Diamond accounts start at economy.diamonds.start-balance (default 0).
  • Real diamonds only: renamed diamonds or ones with lore are fine, custom items on a diamond base (e.g. Nexo) are not. Depositing is blocked in creative and spectator mode (bank.bypass.gamemode, default false).
  • Prices: every coin price has a diamond price with the suffix -diamonds (cost → cost-diamonds, cost.commands.rtp → cost-diamonds.commands.rtp, team.levels.3.cost-diamonds, upgrade steps money-diamonds, sponsor slots price-diamonds, claim ...Diamonds). A missing one costs the coin price divided by economy.diamonds.coins-per-diamond (default 250), rounded up to whole cents (prices per block or level unrounded), so nothing ever becomes free by accident. An update writes missing diamond prices into existing files, computed from the coin prices set there. Payouts (selling claim blocks back) only exist with their own diamond value.
  • Shops: a shop without a diamond price does not trade in diamond mode ("No price set" on the sign) until its owner sets one with /shopedit price.
  • Disbanding a team: the team bank goes to the owner (coins and diamonds) instead of vanishing.
  • Vault: in diamond mode Mira only offers itself as Vault economy with economy.diamonds.vault-provider: true. Otherwise vote, quest or crate plugins could pay out withdrawable diamonds.

Warning: Inventories are shared across worlds. If a world shortcut or world.forced-gamemodes forces creative mode, diamonds taken there can be deposited in survival; the plugin warns at startup then.

YAML
economy:
  # jobs = coins from jobs, diamonds = diamond bank (needs a restart)
  mode: diamonds
  diamonds:
    # Rate for prices without a diamond value: coin price / rate (5000 coins = 20 diamonds)
    coins-per-diamond: 250.0
    start-balance: 0.0
    max-balance: 1000000.0
    min-transfer: 0.01
    currency-name: "Diamond"
    currency-name-plural: "Diamonds"
    currency-symbol: "◆"

# modules/team.yml (example)
team:
  levels:
    3:
      cost: 25000
      cost-diamonds: 100

Accounts and rounding #

Every player automatically gets an account with the starting balance on first join. Queries for players without an account show the starting balance without creating one. All balances are rounded to two decimal places so floating point errors never accumulate; the shop system uses the same rounding. Amounts in /pay and /eco give|take|set are rounded to whole cents as well; an amount that rounds to 0.00 is rejected as below the minimum. Sender and receiver always book the same rounded amount.

Configuration (config.yml) #

YAML
economy:
  # jobs = coins from jobs, diamonds = diamond bank (see above). Needs a restart.
  mode: jobs
  # true = own economy (and Vault provider). false = use a foreign economy
  # through Vault. Changing requires a restart. The diamond bank always
  # runs on the own economy.
  internal: true
  # Starting balance of every new account.
  start-balance: 1000.0
  # Currency name (singular at exactly 1.0), plural and symbol.
  currency-name: "Coin"
  currency-name-plural: "Coins"
  currency-symbol: "⛃"
  # Upper bound per account and smallest allowed /pay amount.
  max-balance: 1000000000.0
  min-transfer: 0.01
  # Entries per /baltop page.
  baltop-entries-per-page: 10

cooldown:
  commands:
    # Seconds between two /pay commands (prevents spam).
    pay: 1

Note: start-balance must be >= 0, max-balance > 0 and at least start-balance, min-transfer >= 0.01 and baltop-entries-per-page >= 1. Deviations are corrected on load and reported once in the log.

Complete example config #

YAML
economy:
  internal: true
  start-balance: 500.0
  currency-name: "Coin"
  currency-name-plural: "Coins"
  currency-symbol: "$"
  max-balance: 10000000.0
  min-transfer: 1.0
  baltop-entries-per-page: 15

cooldown:
  commands:
    pay: 3