Skip to content

Economy Setup

DonutSMPCore includes a built-in economy that registers as the Vault economy provider when the economy module is enabled.

Configuration: plugins/DonutSMPCore/economy/config.yml

Enable

# plugins/DonutSMPCore/config.yml
Modules:
  economy:
    enabled: true

Also enable in core features:

# plugins/DonutSMPCore/core/config.yml
features:
  economy:
    enabled: true

Basic settings

# plugins/DonutSMPCore/economy/config.yml
starting-balance: 0
currency-symbol: '$'
currency-symbol-suffix: false
max-money: 10000000000000
min-money: 0
minimum-pay-amount: 0.001
economy-log-enabled: true

Player commands

Command Description
/balance Check balance
/pay <player> <amount> Send money
/paymenttoggle Block incoming payments
/baltop Money leaderboard

Admin commands

Requires donutsmpcore.eco.admin:

/eco give <player> <amount>
/eco take <player> <amount>
/eco set <player> <amount>
/eco reset <player>

Vault integration

Other plugins using Vault automatically use DonutSMPCore's economy:

// Other plugins
Economy econ = DonutSMPApi.economy().orElse(null);

DonutSMPCore's native API:

DonutEconomy econ = DonutEconomyProvider.require();
econ.deposit(uuid, 100);
econ.getBalance(uuid);

Essentials migration

One-time import from Essentials userdata:

migration:
  import-essentials-on-enable: true
  essentials-userdata-folder: "plugins/Essentials/userdata"

Set to true once, restart, then set back to false.

Sell / worth integration

The worth module handles item selling:

  • /sell hand / /sell all — sell items for money
  • /sell — open sell GUI
  • /worth — look up item values
  • Order market auto-fills buy orders when players sell matching items

Configure prices in worth/prices.yml.

Sell GUI modes

Layout: worth/gui/sell.yml

Mode Behaviour
close (default) Closing the inventory sells deposited items
button Click items.sell to sell; GUI stays open; closing returns leftovers
# worth/gui/sell.yml
mode: button
collect_slots: [0, 1, 2, ]
items:
  sell:
    material: LIME_STAINED_GLASS_PANE
    name: "&a$ {total}"
    lore:
      - "&7Click to sell"
    slot: 52

Button name/lore placeholders: {total}, %total%, {price}, ${price}.

Runtime notes

Balances are cache-first on the main thread; durable writes flush on the plugin IO pool. Online players are warmed on join so Vault plugins do not block the server tick.

Shards (separate currency)

Shards are a second currency managed by the shards module — not Vault money.

Vault $ Shards
Commands /balance, /pay /shard
Module economy shards
API DonutSMPApi.economy() DonutSMPApi.shards()

Both can run simultaneously.

Network notes

On multi-server setups, economy data lives in shared MySQL. Balance changes on one server are visible on all backends after cache refresh.

Troubleshooting

Issue Fix
/pay does nothing Enable economy module + Vault installed
Balance resets Check storage backend (SQLite vs shared MySQL)
Wrong currency symbol Edit currency-symbol in economy config