Overview
This example creates a plugin that:- Welcomes players when they join
- Adds a
/pingcommand to check player latency - Listens to server connection events
- Shows proper plugin structure and initialization
Complete Example
Project Structure
go.mod
Create a new Go module for your plugin:go.mod
main.go
main.go
Building and Running
Initialize the module
Build the plugin
Run the plugin
- Join the proxy to see the welcome message
- Use
/pingto check your latency - Connect to backend servers to see connection messages
Configuration
To configure backend servers, create aconfig.yml file:
config.yml
Key Concepts
Plugin Registration
Plugins are registered by appending to
proxy.Plugins before calling gate.Execute()Initialization Hook
The
Init function is called after the proxy initializes but before it starts accepting connectionsEvent System
Use
event.Subscribe() to listen to proxy events with a priority value (0 is normal)Command Registration
Commands are registered using Brigadier’s fluent API via
proxy.Command().Register()Next Steps
- See Command Plugin Example for advanced command handling
- See Event Listener Example for comprehensive event handling
- Explore the Events API for all available events
- Learn about Command Permissions

