Skip to content

Plugin channels and mods ​

Raw byte messages between a server plugin and client mods, with the same contract everywhere: a Spigot plugin talks to Fabric and Forge mods.

java
// Spigot
ServerNetwork network = BukkitServerNetwork.create(plugin);
network.registerOutgoing("mygame:hello");
network.registerIncoming("mygame:reply", (player, data) -> { /* player is a UUID */ });
if (network.canSend(player.getUniqueId(), "mygame:hello")) {
    network.send(player.getUniqueId(), "mygame:hello", bytes);
}
java
// Fabric / Forge client
ClientNetwork client = ClientNetwork.get();
client.registerOutgoing("mygame:reply");
client.registerIncoming("mygame:hello", data -> client.send("mygame:reply", answer));

Channel names are namespace:path. Handlers run on the client thread.

SurvivalGames is a paid plugin. EranoAPI is open source under the MIT license.