RA-CoinsEconomy
Author: RajaAditya Website: rajaaditya.my.id Version: 1.0.0 API: Paper 1.21.x (Java 17+)
Features
One Currency: Coins
- A simple economy built around a single currency, with a configurable name and symbol (default
Coinsand⛁) - Players check their balance with
/coins - A starting balance for new players
- Extra command aliases come from
config.yml, for example/coin
Two Storage Options
- SQLite for a single server, no setup needed
- MySQL (HikariCP pool) for several servers sharing one balance
Multi-Server Sync
- With MySQL, balance changes on one server invalidate the cache on the others through the BungeeCord plugin messaging channel
- Servers also read fresh data from the database when a player joins, so balances stay consistent
- Sync is switched off automatically when storage is SQLite
Admin Only From Console
- Giving, taking, and setting balances, plus reloading, are meant for the console and for other plugins, not for in-game players. Other plugins on the same server can use RA-CoinsEconomy directly to charge players
PlaceholderAPI
- Show a balance raw, with commas, or abbreviated (1.2K, 1.2M, 1.2B)
Dependencies
| Plugin | Required | Purpose |
|---|---|---|
| PlaceholderAPI | No (softdepend) | Enables %racoins_*% placeholders |
For multi-server sync you need a BungeeCord, Waterfall, or Velocity (compatibility mode) proxy with ip_forward / bungeecord: true enabled on every backend. A message needs at least one online player on the sending server to be delivered, but balances stay correct either way because other servers query the database when a player joins.
Installation
- Place
RA-CoinsEconomy.jarinto yourplugins/folder (HikariCP and the database drivers are bundled) - Restart the server
- Edit
plugins/RA-CoinsEconomy/config.yml - For several servers, choose
database.type: mysqlon all of them with the same database
File Structure
text
1
plugins/RA-CoinsEconomy/
├── config.yml # Database, sync, aliases, currency, messages
└── coins.db # SQLite file (only when type is sqlite)
Configuration
config.yml
yaml
1
database:
type: sqlite # sqlite or mysql
mysql:
host: localhost
port: 3306
database: ra_coins
username: root
password: ""
pool-size: 10
connection-timeout-ms: 5000
sqlite:
file: coins.db
sync:
enabled: true # only effective with mysql
command:
aliases:
- coin # changing aliases needs a full restart
economy:
starting-balance: 0
currency-name: "Coins"
currency-symbol: "⛁"
messages:
prefix: "&e[Coins] &r"
balance-self: "&aYour balance: &e{balance} {symbol}"
balance-other: "&a{player}'s balance: &e{balance} {symbol}"
give-success: "&aAdded &e{amount} {symbol} &ato {player}"
take-success: "&aRemoved &e{amount} {symbol} &afrom {player}"
set-success: "&a{player}'s balance set to &e{amount} {symbol}"
insufficient-balance: "&c{player} does not have enough balance"
player-not-found: "&cPlayer '{player}' not found (never joined the server)"
invalid-amount: "&cInvalid amount, it must be a positive number"
Message placeholders: {balance}, {symbol}, {player}, {amount}.
Commands
| Command | Description | Access |
|---|---|---|
/coins | Show your own balance | racoins.use |
/coins <player> or /coins balance <player> | Show another player's balance | racoins.admin |
/coins give <player> <amount> | Add to a balance | racoins.admin |
/coins take <player> <amount> | Subtract from a balance (never below 0) | racoins.admin |
/coins set <player> <amount> | Set a balance directly | racoins.admin |
/coins reload | Reload the config | racoins.reload |
Permissions
| Permission | Default | Description |
|---|---|---|
racoins.use | true | Check your own balance |
racoins.admin | false | Manage balances. Only effective from the console |
racoins.reload | false | Reload the config. Only effective from the console |
PlaceholderAPI
Requires PlaceholderAPI. Identifier: racoins.
| Placeholder | Example | Description |
|---|---|---|
%racoins_balance% | 1234567 | Raw balance |
%racoins_balance_commas% | 1,234,567 | Balance with commas |
%racoins_balance_formatted% | 1.2M | Abbreviated balance |
%racoins_balance_player_<name>% | 1234567 | Raw balance of another player by name |
License
Developed by RajaAditya — rajaaditya.my.id