HomeJavaModsBungeeBridge
BungeeBridge
header.png ... is the way to let your Spigot-Servers communicate with your Bungeecord-Instance!

For Server-Owners.png
If you install a plugin which needs this API you have to install it using the Installation-Guide. It won't have any effect for you!
Keep in mind: You always have to use the same version of BungeeBridgeS and BungeeBridgeC!!!

For Developers.png
BungeeBridge is - like the name already says - a bridge between Spigot or Bukkit and Bungeecord.
This API gives you the possibility to let Spigot communicate with Bungeecord. You just have to add it to your Workspace (BungeeBridge_Client for Spigot; BungeeBridge_Server for Bungeecord) and maybe to your plugin.yml as "depend" or "softdepend" (BungeeBridgeC and BungeeBridgeS)
Now you can use all packets (See below)

Please note: I'm currently working on BungeeBridge2! That means, that you will not receive full support for version 1.6.3 as it will be deprecated soon anyway.

Installation-Guide.png (Also included in README.txt in BungeeBridge.zip)
1.) Download BungeeBridge.zip from this page!
2.) Unzip the File and copy BungeeBridge_Client.jar to Spigot/plugins/ and BungeeBridge_Server to Bungeecord/plugins/
3.) Startup your Bungeecord and Spigot
4.) Stop your Bungeecord and Spigot
5.) Look into your plugins folder of Spigot & Bungeecord
6.) Edit the config.yml to your need
7.) You're done! Now you can look for plugins who use this API!

Packet-Tutorials.png
Spoiler: Basic Tutorial [Beginner]
This will tell you if a player is on any server on the network:
Code (Text):
PacketIsPlayerOnline packet = new PacketIsPlayerOnline("dommi2212");
Object obj = packet.send();
IsOnlineResult isOnline = (IsOnlineResult) obj;

if(isOnline == IsOnlineResult.ONLINE) {
  System.out.println("Yeah! Dommi is online!");
}
1.) Create a new "PacketItPlayerOnline" with argument "dommi2212"
2.) Send the packet. "packet.send()" returns an Object
3.) Cast "obj" to "IsOnlineResult" (You can see the returned type in the desc. of every packet)
4.) Process the result (Here: Write in console if "dommi2212" is online)
Note: Often you should prefer to run packet.send() async!
Spoiler: PacketCustom-Tutorial [Advanced]
This Tutorial moved to the BungeeBridge-Wiki!
The page can be found here!
Spoiler: Event-API [Expert]
Since version 1.6.0 ("The Event-Update") BungeeBridge offers an Event-API, allowing Spigot to call Events on BungeeCord.
This requires advanced Knowledge in Java, Spigot, Bungeecord and BungeeBridge!

How it works:
A caller (e.g.: ListenerChat) listens on an action. This can be a Spigot-Event, a command or any other action you define. The caller creates an PacketFireEvent with a wrapped Event (e.g.: WrappedAsyncPlayerChatEvent) and sends it to BungeeBridgeS. BBS accepts the packet and extracts the event. Any plugin can register a WrappedEvent to BBS. After extracting the event, BBS checks the database for matching events. If an event is found, BBS calls "toEvent();"-method of the packet and fires it.
Sounds quite complicated? Here the implementation in BungeeBridge for broadcasting Spigot's AsyncPlayerChatEvent to Bungee:

On Spigot:
Registering a listener for AsyncPlayerChatEvent and sending a PacketFireEvent:
Code (Text):

@EventHandler(priority = EventPriority.MONITOR)
   public void onChat(AsyncPlayerChatEvent e) {
     PacketFireEvent packet = new PacketFireEvent(new WrappedAsyncPlayerChatEvent(e.getPlayer().getUniqueId(), e.getMessage(), e.getFormat(), BungeeBridgeC.getBungeename()));
     packet.send();
   }
 
The WrappedAsyncPlayerChatEvent is a wrapped "form" of Spigot's AsyncPlayerChatEvent:
Code (Text):

public class WrappedAsyncPlayerChatEvent extends WrappedEvent {

   private static final long serialVersionUID = -6973004689464370567L;
   private UUID uuid;
   private String message;
   private String format;
   private String bungeename;

   public WrappedAsyncPlayerChatEvent(UUID uuid, String message, String format, String bungeename) {
     this.uuid = uuid;
     this.message = message;
     this.format = format;
     this.bungeename = bungeename;
   }

   public UUID getUUID() {
     return uuid;
   }

   public String getMessage() {
     return message;
   }

   public String getFormat() {
     return format;
   }

   public String getBungeename() {
     return bungeename;
   }
 
On Bungeecord:
Registering the event to the database. This is important to get your event called by Bungeecord:
Code (Text):

PacketFireEventHandler.registerEvent(instance, WrappedAsyncPlayerChatEvent.class);
 
On Bungee the WrappedAsyncPlayerChatEvent is a wrapped "form" of Spigot's AsyncPlayerChatEvent, too. On Bungee WrappedEvents have to declare a "toEvent();"-Method:
Code (Text):

public class WrappedAsyncPlayerChatEvent extends WrappedEvent {

   private static final long serialVersionUID = -6973004689464370567L;
   private UUID uuid;
   private String message;
   private String format;
   private String bungeename;

   public WrappedAsyncPlayerChatEvent(UUID uuid, String message, String format, String bungeename) {
     this.uuid = uuid;
     this.message = message;
     this.format = format;
     this.bungeename = bungeename;
   }

   public UUID getUUID() {
     return uuid;
   }

   public String getMessage() {
     return message;
   }

   public String getFormat() {
     return format;
   }

   public String getBungeename() {
     return bungeename;
   }

   @Override
   public Event toEvent() {
     return new AsyncPlayerChatEvent(uuid, message, format, bungeename);
   }
 
The AsyncPlayerChatEvent on Bungeecord represents Spigot's Event. It has to extend Bungee's Event:
Code (Text):

public class AsyncPlayerChatEvent extends Event {

   private UUID uuid;
   private String message;
   private String format;
   private String bungeename;

   public AsyncPlayerChatEvent(UUID uuid, String message, String format, String bungeename) {
     this.uuid = uuid;
     this.message = message;
     this.format = format;
     this.bungeename = bungeename;
   }

   public UUID getUUID() {
     return uuid;
   }

   public String getMessage() {
     return message;
   }

   public String getFormat() {
     return format;
   }

   public String getBungeename() {
     return bungeename;
   }
 
Now you can just listen on AsyncPlayerChatEvents.
Common Pitfalls:
- PacketFireEvents don't answer. You can't set the result of an event
- You have to declare an "serialVersionUID" of type "private static final long" in the wrapped events, which has to be the same on Bungee and Spigot.
- You have to create an unwrapped event on Bungee, which is returned by the "toEvent();"-method of your WrappedEvent.
- You have to register the wrapped event to the database.

Known Packets.png
Spoiler: PacketChat
Since: 1.6.0
Description: Packet used to chat a message or send a command as a player.
Returns: -
Constructor(s): new PacketChat(UUID uuid, String message);
Spoiler: PacketConnectPlayer
Since: 1.0.0
Description: Packet used to connect a player to a server.
Returns: ConnectResult result
Constructor(s): new PacketConnectPlayer(UUID uuid, String server);
Spoiler: PacketCustom
Since: 1.2.0
Description: Packet used to send custom Subjects & Data.
Returns: Answer of your Bungeecord-Plugin
Constructor(s): new PacketCustom(String channel, Object subject);
Please have a look on the PacketCustom-Tutorial!
Spoiler: PacketFireEvent
Since: 1.6.0
Description: Packet used to fire an event on BungeeCord.
Returns: -
Constructor(s): new PacketFireEvent(WrappedEvent event);
Please have a look on the Event-API-Tutorial!
Spoiler: PacketGetMOTDServer
Since: 1.1.0
Description: Packet used to get the MOTD of a server.
Returns: String MOTD
Constructor(s): PacketGetMOTDServer(String bungeename);
Spoiler: PacketGetOnlineCountGlobal
Since: 1.0.0
Description: Packet used to get count of players on the network.
Returns: int onlinecount
Constructor(s): new PacketGetOnlineCountGlobal();
Spoiler: PacketGetOnlineCountServer
Since: 1.0.0
Description: Packet used to get count of players on a server.
Returns: int onlinecount
Constructor(s): PacketGetOnlineCountServer(String server);
Spoiler: PacketGetPlayerIP
Since: 1.0.0
Description: Packet used to get a player's IP.
Returns: InetSocketAddress address
Constructor(s): new PacketGetPlayerIP(UUID uuid);
Spoiler: PacketGetPlayerName
Since: 1.0.0
Description: Packet used to get a player's name.
Returns: String name
Constructor(s): new PacketGetPlayerName(UUID uuid);
Spoiler: PacketGetPlayersGlobal
Since: 1.0.0
Description: Packet used to resolve the uuid of all players.
Returns: List<UUID> uuids
Constructor(s): new PacketGetPlayersGlobal();
Spoiler: PacketGetPlayersServer
Since: 1.0.0
Description: Packet used to resolve the uuid of all players on a server.
Returns: List<UUID> uuids.
Constructor(s): new PacketGetPlayersServer(String server);
Spoiler: PacketGetPlayerUUID
Since: 1.0.0
Description: Packet used to get a player's uuid by their name.
Returns: UUID uuid
Constructor(s): new PacketGetPlayerUUID(String name);
Spoiler: PacketGetServerByPlayer
Since: 1.2.0
Description: Packet used to get name of a player's server.
Returns: String bungeename
Constructor(s): new PacketGetServerByPlayer(UUID uuid);
Spoiler: PacketGetServerIP
Since: 1.0.0
Description: Packet used to get the IP of a server
Returns: InetSocketAddress address
Constructor(s): new PacketGetServerIP(String server);
Spoiler: PacketGetServers
Since: 1.0.0
Description: Packet used to get the names of all servers.
Returns: List<String> servers
Constructor(s): new PacketGetServers();
Spoiler: PacketGetSlotsServer
Since: 1.5.1
Description: Packet used to get the slots of a server.
Returns: int slots
Constructor(s): new PacketGetSlotsServer(String bungeename);
Spoiler: PacketIsPlayerOnline
Since: 1.0.0
Description: Packet used to check if a player is online.
Returns: IsOnlineResult result
Constructor(s): new PacketIsPlayerOnline(UUID uuid);
new PacketIsPlayerOnline(String name);
Spoiler: PacketIsServerOnline
Since: 1.2.0
Description: Packet used to check if a server is online/responds.
Returns: boolean result
Constructor(s): new PacketIsServerOnline(String bungeename);
Spoiler: PacketKickAllPlayers
Since: 1.0.0
Description: Kicks all Players on the network.
Returns: -
Constructor(s): new PacketKickAllPlayers(String message);
Spoiler: PacketKickPlayer
Since: 1.0.0
Description: Packet used to kick a player from the network.
Returns: -
Constructor(s): new PacketKickPlayer(UUID uuid, String message);
Spoiler: PacketMessageAllPlayers
Since: 1.0.0
Description: Packet used to send a message to all players on the network.
Returns: -
Constructor(s): new PacketMessageAllPlayers(String message);
Spoiler: PacketMessagePlayer
Since: 1.0.0
Description: Packet used to send a message to a player.
Returns: -
Constructor(s): new PacketMessagePlayer(UUID uuid, String message);
Spoiler: PacketRunCommand
Since: 1.5.1
Description: Packet used run command(s) from BungeeCord-Console.
Returns: -
Constructor(s): new PacketRunCommand(String... commands);
Spoiler: PacketSendActionbar
Since: 1.4.0
Description: Packet used to send a actionbar to a player.
Returns: -
Constructor(s): new PacketSendActionbar(UUID uuid, String actionbar);
Spoiler: PacketSendAllTitle
Since: 1.5.0
Description: Packet used to send a title to all players.
Returns: -
Constructor(s): new PacketSendTitle(PackedTitle title);
Spoiler: PacketSendTitle
Since: 1.4.0
Description: Packet used to send a title to a player.
Returns: -
Constructor(s): new PacketSendTitle(UUID uuid, PackedTitle title);
Spoiler: PacketStopProxy
Since: 1.0.0
Description: Packet used to stop the proxy.
Returns: -
Constructor(s): new PacketStopProxy();
new PacketStopProxy(String message);
Spoiler: PacketTellraw
Since: 1.6.2
Description: Packet used to send a JSON- or "Tellraw"-Message to a player. A JSON-String can be obtained easily by using ComponentSerializer#toString(BaseComponent) of Spigot's ChatAPI.
Returns: -
Constructor(s): new PacketTellraw(UUID uuid, String jsonString);
Spoiler: PacketWriteConsole
Since: 1.0.0
Description: Packet used to write a message to the console.
Returns: -
Constructor(s): new PacketWriteConsole(String message);
new PacketWriteConsole(String message, Level level);

Source, Wiki and Documentation.png
The whole BungeeBridge-Project is opensource and can be used under the therms of MIT license!
See this for Source!
Click here for the wiki (not finished yet)!
The documentation is available here for client and here for server!
Of course you are allowed to help me using Issues or Pull-Requests!

Design made by NitroFox0! Make sure to visit his profile!
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

BungeeBridge is a free Minecraft Java mod. Downloaded 4,784 times (via Spigot). Download it and open it directly in the game.

Explore more