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 #
| Command | Syntax | Permission | Default | Description |
|---|---|---|---|---|
/balance | /balance [player] (alias /bal, /money) | economy. | true | Show balance; other players: economy. (true, offline too) |
/pay | /pay <player> <amount> | economy. | true | Transfers money to an online player |
/baltop | /baltop [page] (alias /balancetop, /moneytop) | economy. | true | Leaderboard of the richest players |
/eco give | /eco give <player> <amount> | economy. | op | Credits money (offline too) |
/eco take | /eco take <player> <amount> | economy. | op | Withdraws money |
/eco set | /eco set <player> <amount> | economy. | op | Sets the balance exactly |
/eco reset | /eco reset <player> | economy. | op | Resets to the starting balance |
/eco reload | /eco reload | economy. | op | Reloads 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. = 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. (same rule as /msg). /eco give| 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. in config.:
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)./baltopis technically not available in that mode.
Changing economy. 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| 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) #
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: 1Note: 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 #
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