Skip to content

Redis & Network Setup

Configuration file: plugins/DonutSMPCore/redis.yml

DonutSMPCore uses Redis for cross-server communication when running behind a proxy (Velocity, BungeeCord, etc.).

Prerequisites

  1. Shared MySQL — see Database Setup
  2. Redis server accessible from every backend
  3. Unique server-id per backend
  4. Proxy plugin forwarding player data (standard Velocity/Bungee setup)

Basic configuration

# plugins/DonutSMPCore/redis.yml
server-id: "survival-1"

main-server-id: "hub"   # config owner + debug hub; leave "" for standalone

redis:
  enabled: true
  host: "localhost"
  port: 6379
  password: ""
  timeout: 2000
  pool:
    max-total: 16
    max-idle: 8
    min-idle: 2

Example multi-server layout

Backend server-id Role
Hub hub main-server-id — owns config sync
Survival survival-1 Game world
Spawn spawn-1 Spawn/AFK
world-servers:
  world: "survival-1"
  world_nether: "survival-1"
  spawn: "hub"
  lobby: "hub"

Maps Bukkit world names → backend that hosts them (used for cross-server homes, warps, teleports).

Cross-server features

cross-server:
  config-sync: true          # Push YAML configs from main server
  debug-hub: true            # Aggregate debug logs on main server
  inventory-sync: true       # Sync inventory on server switch
  stats-sync: true           # Merge stats for leaderboards
  presence-ttl-seconds: 30
  heartbeat-interval-seconds: 10
  inventory-ttl-seconds: 120
  teleport-ttl-seconds: 60
  inventory-lock-wait-seconds: 5
  inventory-lock-lease-seconds: 10
Feature What it does
Presence Know which server a player is on (/findplayer, TPA across servers)
TPA bridge Send/accept TPA when players are on different servers
Economy bridge Consistent balance reads via shared MySQL + cache invalidation
Team bridge Team chat and data across servers
Inventory sync Save/load inventory when switching servers (Redisson locks)
Config sync Main server pushes config changes to all backends
Stats sync Combined leaderboards across network

Standalone server

For a single Paper server, leave defaults:

redis:
  enabled: false
main-server-id: ""

No Redis installation needed.

Network API (developers)

When the network is active, other plugins can use:

import net.donutsmp.donutcore.network.api.NetworkApi;

if (NetworkApi.isActive()) {
    String server = NetworkApi.findPlayerServer("Steve");
    NetworkApi.connectToServer(player, "survival-1");
    NetworkApi.notifyPlayer(uuid, name, "&7Hello!");
}

See Java API.

Troubleshooting

Issue Check
Redis connection failed Host, port, password, firewall
Cross-server TPA broken redis.enabled: true, shared MySQL
Wrong server on teleport world-servers mapping
Config not syncing main-server-id set correctly on all servers
Inventory dupes Increase inventory-lock-* seconds