Send a Message to Bungeecord

Hello,
i know that sponge has no multiserver communication, but is there any way to get this code working?

ByteArrayOutputStream bos = new ByteArrayOutputStream();
				DataOutputStream os= new DataOutputStream(bos);
				os.writeUTF("Connect");
				os.writeUTF("Hub-Server");
				player.sendPluginMessage(plugin, "BungeeCord", bos.toByteArray());
				bos.close();
				os.close();

That Code is from an Bukkit Plugin. I have no idea how to replace player.sendPluginMessage(plugin, “BungeeCord”, baos.toByteArray());

Or must i create an plugin for Bungeecord to communicate?

Greetings,
Marco

1 Like

I assume you’re looking for this:

player.getConnection().sendCustomPayload(plugin, "BungeeCord", bos.toByteArray());

I’m not sure if you have to register the channel if you’re only going to send messages. If you have to, there is a registerChannel method in the server class.

Thank you very much.

:blush: :+1: