CoalGov
CoalGov is a server-side Paper plugin for vanilla Minecraft clients. It adds a coal-backed economy, Coal Cents, dynamic resource markets, land ownership, mining permits, government land classes, protected claim markers, NPC traders/workers, and regulated coal mining.
The plugin is designed for a small survival server built around a governed coal basin. Players can deposit physical coal into a ledger, buy land, trade resources with the Ministry, pay fines, and negotiate with NPC traders without requiring any client mods, resource packs, Forge, or Fabric.
Requirements
- Paper
1.21.x - Java
21 - Citizens
2.0.42-SNAPSHOTor compatible - SQLite, bundled through
sqlite-jdbc
Build
This project is a Gradle Java plugin. If a Gradle wrapper is available, use:
./gradlew build
If the server only has Docker, the project can be built with a Gradle image:
docker run --rm -u 0 \
-v "$PWD":/workspace \
-w /workspace \
gradle:8.14.3-jdk21 gradle build
The plugin jar is written to:
build/libs/CoalGov-1.0.0.jar
Install
- Build the jar.
- Copy
build/libs/CoalGov-1.0.0.jarinto the Paper serverplugins/directory. - Install
Citizens.jarin the sameplugins/directory. - Start or restart the Paper server.
- Edit
plugins/CoalGov/config.ymlas needed. - Use
/coalgov admin reloadafter config-only changes.
CoalGov creates its SQLite database at:
plugins/CoalGov/coalgov.db
Economy
CoalGov stores money as integer Coal Cents.
100ccequals1 coal1means1 coalin commands1.25means1 coal 25cc125ccmeans1 coal 25cc- Balances cannot go negative
- Existing whole-coal databases are migrated once to Coal Cents and marked in
schema_meta
Deposits and withdrawals stay tied to physical Minecraft coal:
/coal depositconvertsCOALto100cceach/coal depositconvertsCOAL_BLOCKto900cceach/coal withdraw <amount>creates coal items and therefore requires whole-coal amounts
Market
/market opens a server-side inventory menu where players can sell configured resources to the Ministry or buy from Ministry stock.
Market prices are dynamic:
- Low stock raises prices
- High stock lowers prices
- Buy and sell prices use a configurable spread
- Cheap resources can transact below
1 coalbecause settlement uses Coal Cents - Item lore shows per-item buy/sell prices plus batch prices for 1 and 64
- Market stock is persisted in SQLite
Coal-equivalent materials keep a value floor based on coal, charcoal conversion, or fuel value. Arbitrary/generated materials such as cobblestone do not have a forced whole-coal floor.
Land And Claims
CoalGov supports rectangular and polygon claims.
/claim wandgives the polygon selection wand- Right-click blocks to add polygon points
- Sneak right-click clears the current selection
/claim buy <homestead|industrial> <radius>buys a radius claim/claim buy <homestead|industrial>buys the selected polygon- Claim corners receive protected marker blocks
/claim appraiseestimates resale value from land condition and configured resources/claim sellsells the claim back to the Ministry/showpropertylinesshows the property lines for the claim you are standing in/claim trustand/claim untrustgrant or revoke claim-scoped access for other players
The first small homestead can be free, depending on config.
Claim owners can grant granular access:
build: place and break blocksinteract: use non-container interactable blocks such as doors, buttons, levers, gates, and similar blockscontainer: open inventory blocks such as chests, barrels, furnaces, and hoppersanimal: damage animals inside the claimmanage: manage claim permissionsall: grant or revoke every permission above
Example:
/claim trust 12 Alex build
/claim trust 12 Alex container
/claim untrust 12 Alex build
/claim permissions 12
Unclaimed land does not block animal damage for now. Claimed land blocks animal damage unless the player owns the claim, has animal, has manage, or is using admin bypass.
Land Classes And Mining
Admins can define land regions with classes such as freehold, government land, protected preserves, border zones, and mining concessions.
Coal mining can be denied by land class. Mining concessions require an active mining permit:
/permit buy mining <regionName>
NPCs
CoalGov uses Citizens for NPC agents.
- Trader NPCs have their own inventory and coal account
- Worker NPCs patrol assigned polygon zones
- Worker roles are matched from NPC names, such as
FarmerorBaker - Workers can consume inputs, pull supplies from same-zone NPCs, produce outputs, and stock same-zone traders
- Traders can haggle through
/cgnpc haggle - Optional OpenRouter-backed AI can produce trader messages and counters
Default worker chain:
FarmerproducesWHEATBakerconsumesWHEATand producesBREAD- Same-zone traders accept worker outputs up to the configured restock target
Super Furnace
CoalGov adds a persisted Super Furnace recipe. Craft a furnace with stone in all eight surrounding slots. Super Furnaces smelt faster and consume fuel faster.
Player Commands
/coal balance
/coal deposit
/coal withdraw <amount>
/coal pay <player> <amount>
/coal fines [list|pay <id|all>]
/market
/claim wand
/claim buy <homestead|industrial> [radius]
/claim info
/claim list
/claim show <id>
/claim appraise [id]
/claim sell [id]
/claim transfer <id> <player>
/claim abandon <id>
/claim trust <id> <player> <build|interact|container|animal|manage|all>
/claim untrust <id> <player> <build|interact|container|animal|manage|all>
/claim permissions <id>
/permit buy mining <regionName>
/permit list
/diviningrod
/showpropertylines
/land info
Admin Commands
/land create <name> <landClass> <radius>
/land delete <name>
/land list
/coalgov admin balance <player>
/coalgov admin grant <player> <amount>
/coalgov admin take <player> <amount>
/coalgov admin reload
/coalgov admin bypass <on|off|status>
/coalgov admin rod
/coalgov admin treasury <balance|grant <player> <amount>>
/coalgov admin tax exempt <player> <on|off|status>
/police fine <player> <amount> <reason>
/cgnpc zone create <name>
/cgnpc create <trader|worker> <name> <zone>
/cgnpc stock <id> <material> <amount>
/cgnpc funds <id> <amount>
/cgnpc haggle <id> <buy|sell> <material> <amount> <offer>
Permissions
coalgov.admin: admin commands, defaultopcoalgov.coal: coal economy commands, defaulttruecoalgov.claim: claim commands, defaulttruecoalgov.permit: permit commands, defaulttruecoalgov.land.info: land info commands, defaulttruecoalgov.market: market trading, defaulttruecoalgov.diviningrod: divining rod command, defaulttruecoalgov.police: police fine commands, defaultop
Admin permission alone does not bypass gameplay restrictions. Use /coalgov admin bypass on for build, mining, and marker bypass.
Configuration
Default config lives at:
src/main/resources/config.yml
Important sections:
economy: starting balance and deposit material togglesgovernment.taxes: market sale and purchase tax percentagesclaims: claim prices, size limits, and resale valuespermits: mining permit cost and durationmarket.dynamic: stock pressure and spread settingsmarket.prices: base resource prices in coalland: default land class and mining denial rulesnpc: AI, trader, and worker settingsspawn: optional spawn setup guide signs and protected region
Config prices are written in coal units. CoalGov converts them to Coal Cents internally.
Deployment Notes
For the current Docker-based server layout:
cd /opt/mcworldgen-server/CoalGov
docker run --rm -u 0 -v "$PWD":/workspace -w /workspace gradle:8.14.3-jdk21 gradle build
cp build/libs/CoalGov-1.0.0.jar /opt/mcworldgen-server/data/plugins/CoalGov-1.0.0.jar
cd /opt/mcworldgen-server
docker compose restart mc
Always back up the current plugin jar and plugins/CoalGov/coalgov.db before deploying database-affecting changes.
Manual Test Checklist
- Server starts without CoalGov errors
plugins/CoalGov/coalgov.dbexistsschema_meta.economy_unitsiscoal_cents_v1- Player join creates or updates a
playersrow /coal balancedisplays coal andcc/coal depositcredits100ccper coal item/coal withdraw 1gives one coal item/coal withdraw 1.25is rejected/coal pay <player> 25cctransfers Coal Cents/marketshows per-item and batch prices- Market buy/sell updates stock and balance
/claim buycharges the displayed Coal Cents amount/claim trustallows another player to use only the granted access- A player without
animalaccess cannot kill animals inside another player's claim - Animals on unclaimed land can still be killed
/showpropertylinesdisplays polygon edges between claim marker points/claim appraiseand/claim selldisplay formatted money- Mining protected coal is denied
- Mining concession coal requires a valid permit
/coalgov admin bypass onbypasses build, mining, and marker restrictions