EaglercraftBungee adds two new events to the standard BungeeCord event system. Register them with the standardDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/lDEVinux/eaglercraft/llms.txt
Use this file to discover all available pages before exploring further.
@EventHandler annotation in a Listener class, exactly as you would any BungeeCord event. See Plugin Development for how to set up a listener.
Eaglercraft-Specific Events
WebsocketMOTDEvent
net/md_5/bungee/api/event/WebsocketMOTDEvent.java
getMOTD() to access and modify the MOTD object before it is sent back to the requester.
The MOTD interface (which extends QueryConnection) exposes the following methods:
| Method | Description |
|---|---|
getLine1() / setLine1(String) | First line of the MOTD text |
getLine2() / setLine2(String) | Second line of the MOTD text |
getOnlinePlayers() / setOnlinePlayers(int) | Current online player count |
getMaxPlayers() / setMaxPlayers(int) | Maximum player count |
getPlayerList() / setPlayerList(List<String>) | Hover player list |
getBitmap() / setBitmap(int[]) | Raw server icon bitmap |
getSubType() | The sub-type string for this MOTD request |
sendToUser() | Dispatch the (potentially modified) MOTD to the requester |
For an animated MOTD and icon, install EaglerMOTD, the official reference plugin that uses this event.
WebsocketQueryEvent
net/md_5/bungee/api/event/WebsocketQueryEvent.java
Accept: <query>. Use getAccept() to read the query string and getQuery() to obtain the full QueryConnection object for reading request data and writing a response.
The QueryConnection interface provides:
| Method | Description |
|---|---|
getRemoteAddress() | IP address of the connecting client |
getListener() | The ListenerInfo that received the connection |
getAccept() | The query string sent by the client (Accept: <value>) |
availableRequests() | Number of additional request packets available to read |
readRequestString() | Read the next request payload as a raw string |
readRequestData() | Read the next request payload as a JSONObject |
setReturnType(String) / getReturnType() | Set or get the type field in the response envelope |
writeResponse(JSONObject) | Send a JSON response wrapped in the standard envelope |
writeResponse(String) | Send a string response wrapped in the standard envelope |
writeResponseRaw(String) | Send a raw string response with no envelope |
writeResponseBinary(byte[]) | Send a raw binary response |
keepAlive(boolean) / shouldKeepAlive() | Control whether the connection stays open after a response |
isClosed() | Check if the connection has been closed |
close() | Close the connection |
Standard BungeeCord Events
All standard BungeeCord events are available in EaglercraftBungee without modification. The most commonly used ones are listed below.| Event | Trigger |
|---|---|
LoginEvent | A player is attempting to connect. Cancellable — use setCancelled(true) and setCancelReason(String) to reject the connection. |
PostLoginEvent | A player has successfully logged in and is now fully connected. Use getPlayer() to get the ProxiedPlayer. |
PlayerDisconnectEvent | A player has disconnected. Use getPlayer() to get the ProxiedPlayer. |
ChatEvent | A player sends a chat message or command. Cancellable. Use getMessage() / setMessage(String) to read or modify the text, and isCommand() to detect commands. |
ServerConnectEvent | A player is about to connect to a backend server. |
ServerConnectedEvent | A player has successfully connected to a backend server. |
ServerKickEvent | A player was kicked from a backend server. |
ServerSwitchEvent | A player switched between backend servers. |
PluginMessageEvent | A plugin message was received on a registered channel. |
ProxyPingEvent | The proxy was pinged (standard TCP ping, distinct from WebsocketMOTDEvent). |
PermissionCheckEvent | A permission check was triggered for a player or connection. |