Configuration
Configuration
storage:
type: sqlite
mysql:
host: localhost
port: 3306
database: minecraft
username: root
password: ""
currency:
singular: Dollar
plural: Dollars
decimals: 2
format: short
money: "<#00FF00>$</#00FF00> <amount>"
starting-balance: 0
max-balance: 0
pay:
minimum: 1
cooldown: 1.0
log-days: 30
sounds:
pay-sent:
sound: entity.experience_orb.pickup
volume: 1.0
pitch: 1.0
pay-received:
sound: entity.experience_orb.pickup
volume: 1.0
pitch: 1.0
error:
sound: entity.villager.no
volume: 1.0
pitch: 1.0
network:
enabled: false
redis:
host: localhost
port: 6379
password: ""| Key | Description |
|---|---|
type: under storage: | sqlite (saved in plugins/CashFlow/cashflow.db) or mysql (MySQL and MariaDB) |
singular: under currency: / plural: under currency: | The currency name other plugins can show |
decimals: under currency: | 0, 1 or 2. How many decimals players can type and see |
format: under currency: | short (1.5K, 2.5M) or full (1,500.50) |
money: under currency: | How every amount looks. <amount> is the number. Plugins that use Vault get the same text without colors |
starting-balance | The money a new player starts with |
max-balance | The most money one player can have. 0 means no limit |
minimum: under pay: | The smallest amount players can pay |
cooldown: under pay: | Seconds between two payments from the same player. 0 turns it off |
log-days | How many days the log is kept. /history, /eco history and /eco rollback only reach this far back |
pay-sent: under sounds: | Plays for the payer |
pay-received: under sounds: | Plays for the receiver |
error: under sounds: | Plays with every red message, like "You don't have enough money." |
network | See Network sync below |
Sounds take any sound key, including resource pack sounds, and an empty sound turns that sound off. Short amounts are never rounded up: 999,999 shows as 999.9K. Changing storage or network needs a restart; everything else applies with /eco reload.
Messages
pay-sent: "You paid <player> <money>"
pay-sent-action-bar: "You paid <player> <money>"
pay-received: "<player> paid you <money>"
pay-received-action-bar: "<player> paid you <money>"
pay-offline: "<player> paid you <money> while you were away"
balance: "You have <money>"
balance-other: "<player> has <money>"
paytoggle-off: "You no longer receive payments."
paytoggle-on: "You receive payments again."
paymsgtoggle-off: "Payment messages are now hidden."
paymsgtoggle-on: "Payment messages are now shown."
baltop-header: "Top balances <gray>(<page>/<pages>)"
baltop-line: "<gray><rank>.</gray> <player> <money>"
baltop-self: "Your rank: <gray>#<rank></gray> <money>"
baltop-empty: "Nobody is on the top list yet."
baltop-page: "<previous> <gray>Page <page>/<pages></gray> <next>"
baltop-previous: "<#00FF00>«"
baltop-next: "<#00FF00>»"
history-header: "Your history <gray>(<page>/<pages>)"
history-other-header: "History of <player> <gray>(<page>/<pages>)"
history-empty: "No transactions yet."
history-line: "<gray><time> ago ·</gray> <entry>"
history:
pay-sent: "You paid <other> <money>"
pay-received: "<other> paid you <money>"
admin-give: "<other> gave you <money>"
admin-take: "<other> took <money>"
admin-set: "<other> set your balance to <money>"
plugin-deposit: "<other> gave you <money>"
plugin-withdraw: "<other> took <money>"
rollback: "<other> rolled your balance back to <money>"
history-other:
pay-sent: "<player> paid <other> <money>"
pay-received: "<other> paid <player> <money>"
admin-give: "<other> gave <player> <money>"
admin-take: "<other> took <money> from <player>"
admin-set: "<other> set <player>'s balance to <money>"
plugin-deposit: "<other> gave <player> <money>"
plugin-withdraw: "<other> took <money> from <player>"
rollback: "<other> rolled <player> back to <money>"
eco-give: "Gave <player> <money>"
eco-take: "Took <money> from <player>"
eco-set: "Set <player>'s balance to <money>"
eco-reset: "Reset <player>'s balance to <money>"
eco-received: "You received <money>"
eco-taken: "<money> was taken from you"
eco-set-target: "Your balance was set to <money>"
rollback: "Rolled <player> back to <money>"
reload: "CashFlow reloaded."
usage-balance: '<red>Usage: /balance \<player>'
usage-pay: '<red>Usage: /pay \<player> \<amount>'
usage-eco: '<red>Usage: /eco \<give|take|set> \<player> \<amount> [-s], /eco reset \<player> [-s], /eco history \<player> [page], /eco rollback \<player> \<time>, /eco reload'
not-found: "<red>Player not found."
pay-self: "<red>You can't pay yourself."
pay-off: "<red><player> has payments turned off."
no-money: "<red>You don't have enough money."
invalid-amount: "<red>Invalid amount."
pay-minimum: "<red>The minimum is <money>."
pay-cooldown: "<red>Wait <seconds>s before paying again."
max-balance: "<red><player> can't hold that much money."
eco-not-enough: "<red><player> only has <money>."
rollback-none: "<red><player> has no changes in that time."
invalid-time: "<red>Invalid time. Use 30m, 2h or 3d."
no-permission: "<red>You don't have permission."
players-only: "<red>Only players can use this."Messages use MiniMessage colors. Text with no color is white.
| Tag | Description |
|---|---|
<player> | A player's name |
<money> | An amount, drawn with money: under currency: |
<page> / <pages> | The page you are on and how many there are |
<rank> | A place on the top list |
<seconds> | Seconds left on the pay cooldown |
<time> | How long ago a change happened, like 5m or 2h |
<other> | In history lines: the other player, the admin (Console from the console) or the plugin that made the change |
<entry> | In history-line: the line from history or history-other |
<previous> / <next> | In baltop-page: the baltop-previous and baltop-next arrows. Clicking one opens that page |
history holds the lines players see in /history, and history-other the lines admins see in /eco history. An empty message is not sent, so an empty pay-sent-action-bar turns off the payer's action bar. Names are always shown as plain text, so a name can never add colors.
Placeholders
| Placeholder | Example |
|---|---|
%cashflow_balance% | 1500.5 |
%cashflow_balance_formatted% | 1.5K |
%cashflow_balance_commas% | 1,500.50 |
%cashflow_rank% | 12, or - when the player is not on the top list |
%cashflow_paytoggle% | on when the player receives payments, off when not |
%cashflow_top_<n>_name% | The name at place <n> on the top list |
%cashflow_top_<n>_balance% | Their balance, like 1500.5 |
%cashflow_top_<n>_balance_formatted% | Their balance, like 1.5K |
%cashflow_top_<n>_balance_commas% | Their balance, like 1,500.50 |
The top list is rebuilt every 30 seconds.
Network sync
To share balances between servers:
- Set
type: mysqlunderstorage:on every server, with the same database. - Set
enabled: trueundernetwork:and the Redis address on every server. - Restart the servers.
Changes go through Redis right away, so balances, toggles and new players show up on every server. A payment to a player on another server shows them the message there. If Redis goes down, each server keeps working on its own, logs one warning, and catches up from MySQL when Redis is back. With SQLite, network sync stays off.
One limit: if two servers take money from the same player within the same few milliseconds, both can go through and the balance can end slightly below zero. Both changes are in the log.