NetFlux is a lightweight networking framework for Minecraft servers that allows Paper/Spigot servers to automatically connect to a Velocity proxy and manage player routing via Redis.
It simplifies server orchestration, allows flexible control over how players connect, and supports seamless server switching.
- Paper/Spigot servers register themselves in Redis and automatically connect to the Velocity proxy.
- NetFlux tracks server and player states in real time.
- Players can be routed by server type, specific server ID, or using a custom
ServerPicker. - Standard implementation: RoundRobinPicker — evenly distributes players across servers.
- Developers can override routing logic by creating custom pickers.
- Players can be dynamically moved to other servers based on current load or custom logic.
- Supports automatic reconnection to servers.
NetFlux provides a simple and extensible API:
- Create a class extending
ServerPickerand implement the methodgetServer(UUID, List<LoadedServer>). - Example: distributing players based on least online players, random choice, or your own algorithm.
public class LeastServerPicker extends ServerPicker {
@Override
public Optional<LoadedServer> getServer(@NotNull UUID uuid, @NotNull List<LoadedServer> loadedServers) {
return loadedServers.stream()
.min(Comparator.comparingInt(LoadedServer::getOnlinePlayers));
}
}- Set which server a player connects to on their first join:
Netflux.get()
.getNetfluxServerManager()
.setFirstJoinPicker("lobby", RoundRobinPicker.class);- Using a custom ServerPicker
UUID playerUUID = player.getUniqueId();
Netflux.get()
.getPlayerNetworkGateway()
.connectPlayer(playerUUID, "lobby", RoundRobinPicker.class);
- Directly to a specific server
UUID playerUUID = player.getUniqueId();
Netflux.get()
.getPlayerNetworkGateway()
.connectPlayer(playerUUID, "server_identifier");
- netflux-paper — main implementation for Paper/Spigot servers.
- netflux-paper-api — API for plugin development. Use
compileOnlyin your project:
dependencies {
compileOnly("com.github.cachewrapper.netflux:paper-api:VERSION")
}- netflux-velocity — main implementation for Velocity proxy.
- netflux-velocity-api — API for plugin development. Use
compileOnlyin your project:
dependencies {
compileOnly("com.github.cachewrapper.netflux:velocity-api:VERSION")
}