Skip to content

A plugin for Gate proxy that customizes server list ping responses to display specific supported Minecraft versions with clean version range formatting!

License

Notifications You must be signed in to change notification settings

watermelon1024/gate-ping-protocol

 
 

Repository files navigation

Contributors Forks Stargazers Issues License


Logo

Gate Ping Protocol

A Gate proxy plugin that customizes server ping responses with configurable protocol windows.

Gate docs » · Discord · File an issue

Overview

Gate Ping Protocol hooks into the Minekube Gate PingEvent and rewrites the version banner that Minecraft clients see in the server list. The list of supported protocol numbers and friendly version names is driven entirely by protocol.yml, making it easy to advertise exactly the versions your network supports without touching code.

Highlights

  • Keeps the reported protocol number in sync with the connecting client when possible, preventing red "Incompatible" warnings.
  • Builds readable version ranges automatically (for example 1.19.3-1.20.1).
  • Falls back to Mojang defaults or v<protocol> labels when a custom name is omitted.
  • Logs and skips any malformed entries so a single typo does not crash the proxy.

Quick Start

  1. Clone the repo: git clone <repo-url> and cd gate_ping_protocol.
  2. Copy the sample config: cp protocol.example.yml protocol.yml (or start from scratch).
  3. Describe your supported versions inside protocol.yml (details below).
  4. Run Gate with the plugin enabled: go run . (add -d for verbose debugging).
  5. Ping from your Minecraft client and verify that the server list now advertises the configured versions.

The project ships with config.yml for a minimal proxy setup and Makefile helpers such as make lint and make test for local CI parity.

Configuration (protocol.yml)

Example: (protocol.example.yml)

protocols:
  - number: 761
    names: ["1.19.3"]
  - number: 762
    names: ["1.19.4"]
  - number: 763
    names: ["1.20.1"]
Field Type Required Description
number integer Minecraft protocol number. Leaving it out skips the entry and logs a warning.
names string[] Friendly labels shown to players. When empty, the plugin uses Gate's built-in mapping or falls back to v<number>.

Ordering matters: the plugin iterates from top to bottom to build contiguous ranges. List protocols from oldest to newest (ascending numbers) so the range formatter can detect gaps correctly.

How the plugin responds

  1. When a client pings, Gate emits a PingEvent that the plugin intercepts.
  2. The response banner (ping.Version) is rewritten with:
    • Name: the formatted range string derived from protocols (e.g., 1.19.3-1.20.1).
    • Protocol: the client's own protocol number if it exists in the configured list; otherwise, the first supported protocol to keep the server selectable.
  3. If the client requests a protocol outside the configured set, it still sees the advertised range but is assigned the first supported protocol so the proxy remains joinable.

Running & Development

  • go run . — start Gate with the plugin.
  • go run . -d — enable debug logging (handy for watching ping negotiations).
  • make lint, make test — optional helpers for CI parity.
  • Dockerfile — build a container image (docker build -t gate-ping-protocol .).

Docker Image

Use the published container if you prefer running Gate without installing Go locally:

docker pull ghcr.io/watermelon1024/gate-ping-protocol:latest

Example run command (mount your protocol.yml and expose Gate's default port):

docker run --rm \
  -p 25565:25565 \
  -v "$(pwd)/protocol.yml:/app/protocol.yml:ro" \
  ghcr.io/watermelon1024/gate-ping-protocol:latest

Customize the port mapping or config volume path as needed for your deployment.

(back to top)

About

A plugin for Gate proxy that customizes server list ping responses to display specific supported Minecraft versions with clean version range formatting!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Go 89.2%
  • Dockerfile 7.7%
  • Makefile 3.1%