Skip to Content
MineDuels

Backend config

What to set on the lobby servers and what to set on the duel servers.

Restart after changing storage or cross-server in database.yml. /md reload does not apply them.

Read Roles and common terms first if lobby, game or the two server-name keys are new to you.


What is the same everywhere

These settings are identical on every lobby and every duel server.

SettingValue
storage.type and storage.mysql.*mysql, the same database
cross-server.enabledtrue
cross-server.redis.*The same Redis host, port, password, database and ssl
cross-server.secretThe same secret, at least 32 random bytes
cross-server.assign-timeout-secondsThe same value
Kits (kits/)The same kit files

These settings differ per server:

SettingLobbyDuel server
cross-server.server-nameIts own name from velocity.tomlIts own name from velocity.toml
cross-server.rolelobbygame

Lobby server

A lobby holds the players. It queues them, shows the menus and, when it is elected, pairs the network queue.

database.yml

storage:
  type: mysql
  mysql:
    host: db.internal
    port: 3306
    database: mineduels
    username: duels
    password: change-this

cross-server:
  enabled: true
  server-name: lobby-1
  role: lobby
  redis:
    host: redis.internal
    port: 6379
    password: change-this
    database: 0
    ssl: false
  secret: "paste the shared secret here"
  global-chat: false
  assign-timeout-seconds: 30
  party-away-minutes: 30
  disconnect-grace-seconds: 10

Other settings on a lobby

WhereSettingPurpose
In game/md setlobbyThe lobby spawn. Players arriving from a duel server land here.
matchmaking.ymlqueue.*tick-interval, the ranked range and multi-queue are used by the lobby that is the matchmaker. Keep the file identical on all lobbies, because any lobby can be elected.
matchmaking.ymlqueue.server-nameOptional label in the queue action bar. Not the network name.
guis/server-selector.ymlservers, show-rolesThe /servers menu. List servers by their velocity.toml name to give them a display name, a material or a slot.
guis/lobby-items/Hotbar filesThe lobby, queue, party and post-match items.
kits/Kit filesThe queue menus list these kits.

The found message, the match-found animation and the queue.match-found effects and delay are played on the lobby the player queued from, before the transfer. The duel server does not repeat the message or the animation for queue matches. Keep matchmaking.yml, messages.yml and animations.yml identical on all lobbies. The duel server still gives queue.match-found.effects again while players wait there.

A lobby does not need arenas. The queue works network-wide without an arena pool on the lobby.


Duel server

A duel server runs the matches. Players are sent there only for an assigned match, and they go back to a lobby afterwards.

database.yml

storage:
  type: mysql
  mysql:
    host: db.internal
    port: 3306
    database: mineduels
    username: duels
    password: change-this

cross-server:
  enabled: true
  server-name: game-1
  role: game
  redis:
    host: redis.internal
    port: 6379
    password: change-this
    database: 0
    ssl: false
  secret: "paste the shared secret here"
  assign-timeout-seconds: 30
  return-wait-seconds: 6
  hold:
    enabled: true
    world: ""
    x: -1000000
    y: 200
    z: -1000000
    material: black_concrete
    wait-max-seconds: 8

Other settings on a duel server

WhereSettingPurpose
kits/Kit filesThe same kits as the lobbies.
arenas/Saved arenasA kit can only be hosted when the server has arenas for it and the pool is ready. The free arena counts in the heartbeat decide which duel server the matchmaker picks.
config.ymlarena.*The arena pool: grid and per tick budget. Size it for the number of matches the server hosts at once.
config.ymlmatch.arrival-settle-secondsMinimum seconds between everyone being in the arena and the countdown. Default 2, range 0 to 10.
config.ymlmatch.arrival-wait-max-secondsLongest wait for every client to receive its chunks. Default 6, range 2 to 30.
config.ymlpost-match.game-serverstrue gives matches on a duel server the normal post-match stay and items before players go back to their lobby.
match-start.ymlarrival-box.*A box of client-side blocks around each player until the fight starts (freeze start mode). Keys: enabled, game-server-only, material (default black_concrete) and roof.
match-start.ymlelevator.preloadSends the elevator walls and platform before the countdown.
In game/md setlobbyOptional. Players never wait at the spawn of a duel server.

Key reference

Core

KeyDefaultMeaning
enabledfalseTurns network mode on. It needs MySQL, a password on Redis and a strong secret.
server-namelobby-1The exact name from velocity.toml. 1 to 64 characters of letters, digits and _ . : -.
rolelobbylobby or game.
redis.host, port, password, databaselocalhost, 6379, empty, 0The shared Redis. The password cannot be empty.
redis.sslfalseUse TLS to Redis.
secretemptyThe shared secret. Every message is signed with it.
global-chatfalseChat lines of this server are sent to the others, and chat of other servers is shown here. Both sides need true.
chat-server-nametrueWith global-chat, show [server-name] before lines from other servers. false shows only Name: message. See Global chat.
assign-timeout-seconds30A match is cancelled when its players are not all on the duel server within this time. Range 5 to 300.
party-away-minutes30Lobby: party members that stay on a duel server longer than this leave the party. Range 1 to 1440. A player who disconnects from the network leaves the party at once (needs the proxy plugin).
proxy-server-nameemptyThis server's name under [servers] in velocity.toml, when it differs from server-name.
proxyemptyThe proxy this server sits behind (its proxy-name), when the network has several proxies. The server is in the region of that proxy, if the proxy has one. The old region key was removed: set region on the proxy. See Regions.
disconnect-grace-seconds10Duel server: how long the other players of a found match wait for a player who disconnected. If the player reconnects in time the proxy sends them to the duel server. Range 3 to 60.

Global chat

With global-chat: true on both servers, a line typed on lobby-2-eu appears on lobby-1 like this:

[lobby-2-eu] ClownButSleepy: hello

Hide the server name in database.yml:

cross-server:
  global-chat: true
  chat-server-name: false
ClownButSleepy: hello

The same setting applies to the console line. The wording lives in messages.yml:

cross-server:
  global-chat: "<server-tag><white><player></white><dark_gray>:</dark_gray> <gray><message>"
  global-chat-server-tag: "<dark_gray>[<gray><server></gray>]</dark_gray> "

<server-tag> is the global-chat-server-tag line, or nothing when chat-server-name is false. Restyle the tag in global-chat-server-tag:

cross-server:
  global-chat-server-tag: "<aqua><server></aqua> <dark_gray>|</dark_gray> "
lobby-2-eu | ClownButSleepy: hello

Update note: when messages.yml is updated, an untouched global-chat line is replaced with the <server-tag> version. A line you changed is kept. If you turned chat-server-name off and your own line has no <server-tag>, the plugin logs a warning at startup and the name stays in the line. Add <server-tag> to your line to use the setting. A restart is needed after changing chat-server-name.

Duel server only

KeyDefaultMeaning
return-wait-seconds6After a match the server asks the proxy to move the player to a lobby and waits this long for them to leave. If they are still there, they are teleported out of the arena instead. Range 2 to 9.
hold.enabledtruePlayers wait on a block of their own until everyone of their match is loaded. false makes them wait in the arena.
hold.worldemptyThe world of the waiting blocks. Empty uses the arena world.
hold.x, y, z-1000000, 200, -1000000Where the row of waiting blocks starts. Choose a spot far from every arena. Each player gets a spot 4 blocks further along x.
hold.materialblack_concreteThe block under the waiting players. It must be a solid block.
hold.wait-max-seconds8The longest to wait for a client that does not report its world as loaded. Range 2 to 60.

Redis message protection

The defaults suit most networks. All servers and the proxy should use the same values.

KeyDefaultMeaning
max-message-bytes65536Larger messages are refused. Range 4096 to 262144.
window-seconds30Messages whose timestamp differs from the local clock by more than this are refused. Range 5 to 120.
nonce-capacity50000How many message ids are remembered to refuse repeats. Range 1000 to 1000000.
limits.pre-auth2000Messages per second accepted before they are checked.
limits.heartbeat5Heartbeats per second accepted from one server.
limits.chat20Chat messages per second accepted from one server.
limits.other100Other messages per second accepted from one server.

Single server or network

Setupcross-server.enabledstorage.typerole
One Paper serverfalsesqlite is finenot used
Velocity networktrue on every backendmysqllobby or game per server

With storage.type: sqlite and enabled: true, cross-server stays disabled. Fix the storage or turn cross-server off.

On this page