Content generated with AI — it may contain mistakes.

Gameplay

Minigame and network modules

Arenas, escrow, trades, lobbies, modes, network messages, playtime, respawns and plugin hooks: the pieces game plugins share.

Modules for plugins that run matches, queues and events, so none of them rebuilds the same plumbing. Each one is reached through its static entry class, like every other module, and each has a full guide in the library's docs/ folder.

ModuleEntry pointSinceWhat it is for
ArenasArenaPool.of(plugin, prefix)1.346.0Arenas handed out one match at a time: the original when free, else a copy pasted into the temporary world, up to a limit per arena. Released arenas are regenerated before the next match.
EscrowEscrow.of(plugin)1.345.0Money and items held while a match is played. Written before anything moves, settled or refunded exactly once, refunded after a crash, owed rows delivered on join or respawn.
TradesTrades.of(plugin)1.349.0A two-player trade window: both see both offers live, both confirm, and a countdown that any change resets. Closing, leaving, dying or a stop gives everything back.
LobbyLobby.of(plugin, hooks, messages)1.356.0Tables, seats and invitations: open tables, clickable invitations, minimum and maximum seats, start when full or on the host's word, expiry. One table per player, server-wide.
ModesModes.register(plugin, mode)1.356.0Every way to play the server offers, in shared categories, on one screen that shows state and players live.
NetworkNetwork.of(plugin)1.347.0Messages from a plugin to itself on one other server, or on the server a player is on, plus awaitArrival for players the proxy is sending here.
Server commandsServerCommands.of(plugin)1.337.0Commands run for a player on a given server of the network, now or on their next join there.
PlaytimePlaytime.of(plugin)1.341.0Network-wide played time, one tracker per server shared by every plugin, idle time dropped.
RespawnsRespawns.of(plugin)1.440.0Where players respawn and code that runs once they stand again.
HooksSkillHooks.suspend(plugin, player)1.409.0Turns other plugins' mechanics off for a player in a minigame (AuraSkills and mcMMO experience, abilities and combat stats; permission groups).
WipesWipes.of(plugin)1.439.0New season and player resets by what tables hold. Already covered under Commands.

Respawns on Folia

Folia fires neither PlayerRespawnEvent nor PlayerPostRespawnEvent when a player respawns after dying, so a plain listener silently does nothing there. The module drives the same rules from the events on Paper and detects the respawn itself on Folia.

Respawns.of(this).location(EventPriority.HIGH, ctx -> ctx.bedSpawn() ? null : spawn.location());
Respawns.of(this).after(player -> kits.giveStarter(player));

Rules run in priority order, the last non-null answer wins, and with no reasons a rule only sees deaths.

Playtime

One tracker per server counts time with idle stretches dropped (five minutes without moving, looking, typing or clicking by default). online(uuid) reads memory, total(uuid) reads the database for anybody, and onMinute(plugin, consumer) runs once a minute for every online player. Point the plugins of every server at one database and the totals are network-wide. The table is exylia_playtime.

Network messages

Network.send(server, channel, payload) and send(playerId, channel, payload) deliver to the same plugin on the addressed server only. The result is SENT, NO_NETWORK (no Redis, or no proxy bridge to find the player) or NO_PLAYER. Messages are events, not state: what must be known afterwards goes to a repository. Without Redis a send to this server still arrives.

Network groups

Since 1.576.0. A network is rarely one game: two survivals share money and an auction house, a boxpvp server keeps its own, the lobby has neither. Each server says its group once, in ExyliaLib's config.yml (network-group: survival, empty for none), and every plugin reads it through NetworkGroups. A plugin never adds a group setting of its own for the server.

Whatever a plugin keeps that a network may share offers the same four words:

SettingMeans
default (or blank)This server's group; every server when it has none.
globalEvery server on the database.
serverThis server alone, by its server-id.
any other nameThat group, whatever this server's own is.
CallDoes
NetworkGroups.current() / hasGroup()This server's group as a scope ("" when none), and whether it has one.
NetworkGroups.scope(plugin, setting)The database scope a setting names, for repository(type, scope). Never throws.
NetworkGroups.matches(plugin, list)Whether this server is in a list of groups and server-ids; empty means every server. For things that exist only on some servers.

Names are lower case, - counts as _, letters, digits and _, at most 24. Data written under one group stays there when a server changes group.

Unique server names (1.581.0): off H2, every server writes its row to exylia_servers once a minute. A server that finds another live process under its own name logs a severe error, and the setup wizard refuses a name a running server uses.

Something missing on this page? Tell us on Discord