🪶Installation
Requirements
Server
Paper / Spigot 1.20.5+ or 1.21.x (api-version: 1.20)
Java
21
Database
MySQL or MariaDB — required, shared by every server
Redis
Optional, strongly recommended for networks
Vault
Optional (softdepend) — only needed for third-party Vault plugins
Steps
Drop the
NetworkEconomyjar intoplugins/on every server that should share the economy.Start the server once. It will generate
config.ymland then disable itself if it cannot reach a database — that is expected on the first run.Fill in the
storagesection with your MySQL / MariaDB details, and theredissection if you are using Redis.Set a unique
server-idon each server (see below).Start the server again. The schema is created automatically on first successful connection.
server-id: "lobby-1"
storage:
host: "127.0.0.1"
port: 3306
database: "networkeconomy"
username: "root"
password: "changeme"
redis:
enabled: true
host: "127.0.0.1"
port: 6379server-id must be different on every server of the network. It identifies the origin server in transaction logs, and it is how a node recognises and ignores its own Redis broadcasts. Two servers sharing an id will ignore each other's balance updates.
Point every server at the same database. A per-server database defeats the entire purpose — and if two servers use different databases while sharing a Redis channel, they will apply each other's balances on top of unrelated rows.
Database setup
Create an empty database and a user that can create tables in it:
The three tables (ne_accounts, ne_balances, ne_transactions) are created on startup by the bundled schema.sql; {prefix} is substituted with your configured table-prefix. There is nothing to import by hand.
Redis setup
Redis is only used for pub/sub cache invalidation — no balances are stored in it, so it needs no persistence and losing it never loses money.
Every server must use the same channel. If Redis fails to connect at startup the plugin logs a warning and continues in DB-only mode, refreshing caches on a timer instead.
Vault
If Vault is installed, NetworkEconomy registers itself as the economy provider at the highest priority and logs Registered NetworkEconomy as the Vault economy provider. Existing Vault plugins then work unchanged and automatically become network-wide.
Remove any other economy plugin (EssentialsX Economy, CMI economy, …) before installing NetworkEconomy. Two economy providers on one server means Vault plugins may read balances from one and write to the other.
Verifying the setup
Console shows
NetworkEconomy enabled (server-id: ...)./balancereturns your starting balance (100 coins by default)./eco give <you> 500on server A, then/balanceon server B — the new value should be visible immediately with Redis enabled./transactionsshows thegiveyou just made, with server A'sserver-idon the entry.
If any of that fails, see troubleshooting.md.
Building from source
Requires JDK 21.
Last updated