Hello, first of all, excuse me for my English a little hazardous, I am a French student, and my English is a big point on which I have to improve myself ^^
I was wondering if there was an equivalent in the sponge API to this in the spigot API or Bukkit?
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Subchannel");
out.writeUTF("Argument");
Player player = Bukkit.getPlayerExact("Example");
player.sendPluginMessage(this, "BungeeCord", out.toByteArray());
It’s really convenient for players to switch between different servers without logging out.
Here, you can find the documentation https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/
Thank’s for your help !
1 Like
FRENCH
Merci bien pour ta réponse rapide, je vais regarder cela, mais à première vue c’est parfaitement ce que je cherche.
Je n’ai pas encore vérifié si ça fonctionne encore, cependant cela m’a donné une idée du principe/ fonctionnement . Je pourrais tenté de bricoler
ENGLISH
Thank you for your quick answer, I’ll look at that, but at first glance that’s exactly what I’m looking for.
I have not checked yet if it still works, however it gave me an idea of the principle. I could try to tinker
No French here, sorry.
I haven’t updated it in a while. I don’t know whether it still works. To answer your question on how to do that exact operation in Sponge:
Player player = Sponge.getServer().getPlayer("Example").get();
Sponge.getChannelRegistrar().getOrCreateRaw(this, "BungeeCord").sendTo(player, buf -> buf.writeUTF("Subchannel").writeUTF("Argument"));
1 Like
That’s perfect, thank’s !
1 Like