
NATS Player Data Bridge
Sync player data across Minecraft servers using NATS.
About this Mod
NATS Player Data Bridge
This project is in its early stages and undergoing active development.
Please report any issues on GitHub or join the community on Discord.
Any feedback is valuable and greatly appreciated!
A server-side Fabric mod that synchronizes player inventories, ender chests, health, XP, statistics, and advancements across multiple Minecraft servers using NATS JetStream.
When a player leaves, their data is saved to a NATS Key-Value bucket. When they join another server in the same cluster, that data is fetched and applied before they spawn.
Requirements
- NATS server with JetStream enabled.
- Fabric API.
Installation
- Drop the mod jar into your
mods/folder. - Start the server once to generate two config files.
- Configure
config/nats-fabric.jsonwith your NATS server URL, auth token, and a unique name for this server. - Restart.
Setting up the NATS Server
When setting up your NATS server, create a new text file named nats-server.conf and paste the following minimal configuration into it:
port: 4222
authorization {
token: "your_secret_token_here"
}
jetstream {
store_dir: "./jetstream-data"
}
Then, start your NATS server by pointing it to the configuration file you just created:
- Linux/macOS:
./nats-server -c nats-server.conf - Windows:
nats-server.exe -c nats-server.conf
Ensure the auth token in config/nats-fabric.json matches what you have set here.
Velocity Proxy Support
If you are running Velocity, set "proxyMode": true in config/nats-player-data-bridge.json. Without this, overlapping logins are rejected outright, which will break server switching.
If you are also using FabricProxy-Lite, you must set hackEarlySend = true in FabricProxy-Lite.toml for the mod to work correctly.
Configuration (config/nats-player-data-bridge.json)
| Key | Default | Description |
|---|---|---|
proxyMode |
false |
Enable RPC lock handoff for Velocity proxy setups. |
rpcTimeoutSeconds |
15 |
The timeout in seconds for cross-server RPC requests (e.g., during proxy transfers). |
syncStats |
true |
Sync player statistics. |
syncAdvancements |
true |
Sync advancements. |
filterMode |
"whitelist" |
"whitelist" syncs only listed NBT keys. "blacklist" syncs everything except listed keys. |
filterKeys |
Inventory, health, XP, etc. | The NBT keys to include or exclude depending on filterMode. |
backupHistoryCount |
20 |
The number of historical snapshots to keep per player in the backup bucket. |
autoBackupPolicies |
[DEATH, DIMENSION_CHANGE] |
List of triggers that automatically create snapshots. |
Admin Commands
All commands require operator permissions.
| Command | Description |
|---|---|
/nats sync [player] |
Manually push a player's data to the cluster. |
/nats sessions list [page] |
View DIRTY session locks in the cluster (paginated). |
/nats sessions clean <player/uuid> |
Clear a stuck session lock for a specific player by name or UUID. |
/nats backup push <player> |
Create a manual snapshot of a player's data. |
/nats backup list <player> |
View snapshots. Hover over entries for tags (death, dim_change, etc). |
/nats backup restore <player> <rev> |
Stage a restoration. Requires /nats backup confirm to execute. |
/nats backup confirm |
Execute a staged restoration. The player will be kicked to apply data safely. |
Data Handling
The bridge is built for environments where data integrity and network stability are critical.
- Cluster-Wide Locking: Each player session is assigned a unique lock. A server can only write data if it holds that lock.
- Fail-to-Safety (Vaulting): If NATS is unreachable, player data is saved to a local disk vault (
nats-player-data-bridge/pending_sync/) and automatically synced back when the connection is restored. - Self-Healing: Servers perform a recovery step on startup to reconcile orphaned locks and clear any local vault data.
- Auto-Backups: Configurable triggers (Death, Dimension Change) create snapshots automatically.
- Binary Format: Data is packed into a CBOR binary format with Zstd compression for minimal network overhead.
- Readiness Gating: Servers block player joins until background synchronization and healing are 100% complete.
License
MIT
Available Versions
How to Install NATS Player Data Bridge on Your Server
Order Server
Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).
Set fabric Loader
In the panel under "Egg", select the fabric loader and matching Minecraft version (26.1.2).
Install Mod
Open the mod browser in the dashboard and search for "NATS Player Data Bridge". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.
Compatibility
Mod Loaders
Minecraft Versions
26.1.2, 26.1.1, 26.1
Server-side
✓ RequiredRecommended RAM
4 GB(min. 3 GB)Frequently Asked Questions
NATS Player Data Bridge server crashes on startup – what to do?
Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (26.1.2). You can switch loaders with one click in the panel.
Is NATS Player Data Bridge compatible with fabric?
NATS Player Data Bridge officially supports fabric for Minecraft 26.1.2, 26.1.1, 26.1. The Mado dashboard automatically detects incompatible loader combinations.
Server lagging with NATS Player Data Bridge – how to optimize performance?
Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if NATS Player Data Bridge consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.
Similar Mods
Rent Modded Server
Install NATS Player Data Bridge with just one click on your server.