2

I try to use the BungeeCord Message Channel on Velocity.

I know this work. Here is my code:

player.sendMessage("§aWait...");
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF("Lobby2");

player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());

This code works, if I use BungeeCord as my proxy. But not if I use Velocity.

Undercraft_CR
  • 55
  • 1
  • 9
  • Are you sure "Lobby2" is on the velocity proxy that you are actually logged on ? because this should do the trick – Elikill58 Feb 27 '22 at 12:38
  • Yes the Server Lobby2 in connect with the velocity proxy. If you mean this. I have the same configuration also on waterfall and there works. And: if I enter the command '/server Lobby2' ingame I connect to the Lobby2 Server – Undercraft_CR Feb 27 '22 at 15:38

1 Answers1

2

Since more recent Minecraft versions, it is recommended to use the bungeecord:main channel (though Velocity should support both just fine).

Also, it is important to make sure that you use a Velocity version newer than v1.1.0 (as seen here).

Another thing, though it should not be necessary (and probably won't change anything for this issue), it's recommended to also enable velocity-support.

If you remain having this issue, it might be best to create an issue on the Velocity Github repository, so they may be able to help you further!

Dieter Blancke
  • 82
  • 1
  • 4
  • 9
  • Sorry but if I execute the command I get this exception: org.bukkit.plugin.messaging.ChannelNotRegisteredException: Attempted to send a plugin message through the unregistered channel `bungeecord:main'. – Undercraft_CR Mar 01 '22 at 15:32
  • Make sure to register the channel onEnable like so: getServer().getMessenger().registerOutgoingPluginChannel(this, "bungeecord:main"); – Dieter Blancke Mar 01 '22 at 22:43