Plugin Channels
Plugin channels (also called plugin messages) allow custom data communication between clients, proxies, and servers using the Minecraft protocol. Gate provides comprehensive support for both legacy and modern plugin channel formats.Plugin Message Packet
All plugin messages use theplugin.Message packet:
Standard Plugin Channels
Gate defines constants for standard Minecraft plugin channels:Channel Name Transformation
Gate automatically transforms legacy channel names to modern format for 1.13+ clients:MC|Brand→minecraft:brandREGISTER→minecraft:registerUNREGISTER→minecraft:unregisterBungeeCord→bungeecord:main- Other legacy names →
legacy:<lowercased>
Brand Channel (minecraft:brand)
The brand channel identifies the client or server software:Reading Brand Messages
Rewriting Brand Messages
Gate automatically rewrites brand messages to indicate proxy presence:- Original:
"vanilla" - Rewritten:
"vanilla (Gate by Minekube)"
Registration Channels
Clients and servers use registration channels to announce supported plugin channels:Checking Registration Messages
Parsing Channel Lists
Registration messages contain null-terminated channel names:Constructing Registration Packets
Sending Plugin Messages
To Player (Client)
To Server (Backend)
Receiving Plugin Messages
Handle incoming plugin messages in session handlers:Common Plugin Channels
BungeeCord Channel
The BungeeCord plugin channel (bungeecord:main) allows server-to-proxy communication:
Connect- Transfer player to another serverConnectOther- Transfer another playerIP- Get player IP addressPlayerCount- Get server player countPlayerList- Get player listGetServers- Get server listMessage- Send message to playerForward- Forward plugin messageUUID- Get player UUIDUUIDOther- Get another player’s UUID
Forge/ModLoader Channels
Gate supports Forge and Fabric mod channels:Custom Mod Channels
Create custom channels for your mods:Channel Message Sink/Source
Gate provides interfaces for plugin message handling:Player and ServerConnection implement these interfaces:
Advanced: Binary Data Encoding
For structured plugin messages, use encoding packages:Complete Example: Custom Plugin Channel
Best Practices
- Always register channels before sending plugin messages
- Use modern channel names (namespace:channel) for 1.13+
- Handle both legacy and modern channel names for compatibility
- Validate message data before processing to prevent crashes
- Use structured encoding (varint, string, etc.) for complex data
- Check for nil server connections before sending to backend
- Log unknown channels for debugging
See Also
- Packets - Packet encoding/decoding
- Sound System - Sound packet handling
- Message Package - Channel identifiers
- BungeeCord Protocol - BungeeCord channel reference

