So I've been looking at a bit of bungeecord stuff, I got a bit of it to work like connect, but I can't figure out how to send a plugin message without using a player, for example to get player count for a server, how would I send a message through the channel without using a player. Like I know it's "out.writUTF("PlayerCount")" etc but how do I send the message then get the output?
Yes I know I've seen that quite a bit but when I make it a listener it lists a player as one of the args which doesn't make sense since I don't want players to interact with getting the player count at all.
That is when a message is received, not when sending and reading a response. Edit: I believe player is null if the message doesn't require a player
PlayerCount(top) Get the amount of players on a certain server, or on ALL the servers. Arguments String the name of the server to get the player count of, or ALL to get the global player count Receiver Any player Example Code (Java): out.writeUTF("PlayerCount"); out.writeUTF("pvp"); Response Code (Java): String server = in.readUTF(); // Name of server, as given in the arguments int playercount = in.readInt(); See, I see this and I have no idea where he gets the value "in" I'm pretty sure I've read it over enough and the only time I see the variable in is the receiving bit which has a player arg so it's not making sense to me. Could you give me some pseudo code?
Meh, people need to do their research on minecraft. A Plugin Message is just a packet that Minecraft once added. Bungeecord and the server itself are not directly connected. They use the plugin message packet through a player to communicate. If you want to do it without a player, either use something like a database or make them actually connected using sockets
You NEED a player to send Plugin Messages! You might be able to send data without these channels, but via sockets/database and not via a plugin message.
I dunno, I recall that in the past I was pulling data from a bungee network I was working for without needing players. Oh well.