CoreEngineWIKI
ESC
↑ ↓ NavigateEnter OpenESC Close

Economy

CoreEngine 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 #

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

  • internal: true (default): CoreEngine 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: CoreEngine 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.

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:
  # true = own economy (and Vault provider). false = use a foreign economy
  # through Vault. Changing requires a restart.
  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