Skip to main content

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 the plugin.Message packet:
Example:

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:
Transformations:
  • MC|Brandminecraft:brand
  • REGISTERminecraft:register
  • UNREGISTERminecraft:unregister
  • BungeeCordbungeecord:main
  • Other legacy names → legacy:<lowercased>
Example:

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:
Example transformation:
  • Original: "vanilla"
  • Rewritten: "vanilla (Gate by Minekube)"
Implementation:

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:
Example:

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:
Supported BungeeCord sub-channels:
  • Connect - Transfer player to another server
  • ConnectOther - Transfer another player
  • IP - Get player IP address
  • PlayerCount - Get server player count
  • PlayerList - Get player list
  • GetServers - Get server list
  • Message - Send message to player
  • Forward - Forward plugin message
  • UUID - Get player UUID
  • UUIDOther - 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:
Both Player and ServerConnection implement these interfaces:

Advanced: Binary Data Encoding

For structured plugin messages, use encoding packages:

Complete Example: Custom Plugin Channel

Best Practices

  1. Always register channels before sending plugin messages
  2. Use modern channel names (namespace:channel) for 1.13+
  3. Handle both legacy and modern channel names for compatibility
  4. Validate message data before processing to prevent crashes
  5. Use structured encoding (varint, string, etc.) for complex data
  6. Check for nil server connections before sending to backend
  7. Log unknown channels for debugging

See Also