send a custom plugin message to said server

Solutions on MaxInterview for send a custom plugin message to said server by the best coders in the world

showing results for - "send a custom plugin message to said server"
Roberto
01 Sep 2018
1	// Sending
2ByteArrayDataOutput out = ByteStreams.newDataOutput();
3out.writeUTF("Forward"); // So BungeeCord knows to forward it
4out.writeUTF(recipientServerName);
5out.writeUTF(channelName); // The channel name to check if this your data
6
7ByteArrayOutputStream msgbytes = new ByteArrayOutputStream();
8DataOutputStream msgout = new DataOutputStream(msgbytes);
9try {
10	msgout.writeUTF(dataToSend);
11	msgout.writeShort(shortAlsoIntDataToSend);
12} catch (IOException exception){ exception.printStackTrace(); }
13
14out.writeShort(msgbytes.toByteArray().length);
15out.write(msgbytes.toByteArray());
16
17System.out.println("Sending message");
18playerSender.sendPluginMessage(main, "BungeeCord", out.toByteArray());
19
20	//Responce
21String subChannel = in.readUTF();
22short len = in.readShort();
23byte[] msgbytes = new byte[len];
24in.readFully(msgbytes);
25
26DataInputStream msgin = new DataInputStream(new ByteArrayInputStream(msgbytes));
27String somedata = msgin.readUTF(); // Read the data in the same way you wrote it
28short somenumber = msgin.readShort();
queries leading to this page
connect plugin messagebungeecord get server plugin message channelbungeecord messaging channel examplebungeecord messaging channel from spigothow to bungeecord plugin messaging channelenable message plugin spigotspigot on messagebungeecor pluginmessaging channelsend bungee message from spigot pluginbungeecord message channelserver send message spigtplugin messaging channel bungeecordbungee channelbungee messages pluginbukkit send plugin messageplugin message listenerbungeecord connect plugin messagebukkit send plugin message getserverbungeecord detect connect plugin messagebungee plugin messagingbugee how to use the plugin messaging channelspigot get players from bungee server with plugin channelserver send pluginbugneecord 2cessaging channelspigot plugin messagingmessaging other servers on bungeecord from spigotbungeecord plugin messagingminecraft bungeecord message channelbungeecord dectect connect pluginmessagesend a custom plugin message to said serverbungeecord plugin messaging check online playersbungeecord messaging channelget players online on server bungeecord messaging channelsend plugin message spigotbungee cord messaging channelbungeecord message channel kickhow to use the plugin messaging channelspigot bungeecord messagebungee plugin messaging apiplugin messagingbungeecord messaging listenerbukkit get server plugin message channelspigot message pluginbungee messaging channelplugin messaging channe 3bbukkit bungee messaging channelsend bungee message from spigotbugngeecord how to recieive a plugin messagebukkit getserver name plugin message channelbukkit plugin bungeecordspigot bungeecord messaging channelsend a custom plugin message to said server