Send a custom plugin message to said server

	// Sending
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Forward"); // So BungeeCord knows to forward it
out.writeUTF(recipientServerName);
out.writeUTF(channelName); // The channel name to check if this your data

ByteArrayOutputStream msgbytes = new ByteArrayOutputStream();
DataOutputStream msgout = new DataOutputStream(msgbytes);
try {
	msgout.writeUTF(dataToSend);
	msgout.writeShort(shortAlsoIntDataToSend);
} catch (IOException exception){ exception.printStackTrace(); }

out.writeShort(msgbytes.toByteArray().length);
out.write(msgbytes.toByteArray());

System.out.println("Sending message");
playerSender.sendPluginMessage(main, "BungeeCord", out.toByteArray());

	//Responce
String subChannel = in.readUTF();
short len = in.readShort();
byte[] msgbytes = new byte[len];
in.readFully(msgbytes);

DataInputStream msgin = new DataInputStream(new ByteArrayInputStream(msgbytes));
String somedata = msgin.readUTF(); // Read the data in the same way you wrote it
short somenumber = msgin.readShort();

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
how to use the plugin messaging channel Bungeecor PluginMessaging Channel bugngeecord how to recieive a plugin message bugee how to use the plugin messaging channel bungee plugin messaging enable message plugin spigot bukkit bungee messaging channel spigot get players from bungee server with plugin channel Plugin.Messaging spigot on message spigot bungeecord messaging channel spigot bungeecord message bungeecord connect plugin message connect plugin message Bungee Messages plugin server send plugin send plugin message spigot bungee cord messaging channel server send message spigt bugneecord ,essaging channel Bungeecord messaging channel from spigot bukkit plugin bungeecord spigot message plugin bungee plugin messaging api plugin messaging channel bungeecord bukkit getServer name plugin message channel bukkit get Server plugin message channel bungeecord get Server plugin message channel bukkit send Plugin Message getserver bukkit send Plugin Message get players online on server bungeecord messaging channel bungeecord plugin messaging check online players plugin messaging channe; bungeecord messaging channel bungeecord messaging listener plugin message listener bungeecord detect Connect plugin message bungeecord dectect Connect pluginmessage how to BungeeCord Plugin Messaging Channel bungee messaging channel spigot plugin messaging bungee channel bungeecord message channel kick bungeecord message channel bungeecord messaging channel example send bungee message from spigot plugin send bungee message from spigot messaging other servers on bungeecord from spigot bungeecord plugin messaging minecraft bungeecord message channel Send a custom plugin message to said server
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source