Open joshwenke opened 11 years ago
I need that, i have an bungee server
PLEASE PLEASE DO THAT NJOL!!!! I REALLY WOULD LIKE THIS BECAUSE I AM RUNNING A MINECRAFT SERVER NETWORK AND IT WOULD BE SOOOOOO COOOL!
I might add this eventually, though it might need more support as adding a plugin hook is more work than simply adding new Skript stuff.
Link for reference: http://www.spigotmc.org/wiki/bungeecord/
By more support do you mean people who want it? Because I'm guessing many people would LOVE the feature, including myself, but not everybody may come to this github post etc.
Njol it is fairly simple but you probably already know that...but its just checking if Bungee exists then creating the plugin channel as that is what BungeeCord uses for teleportation and commands This is what i used in one of my plugins:
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
dos.writeUTF("Connect");
dos.writeUTF("lobby"); //This being the name of the server to connect to
p.sendPluginMessage((Plugin) plugin, "BungeeCord", baos.toByteArray());
dos.close(); //dont forget to close
baos.close(); //not sure if this is the right order to close either but im pretty sure it is
Source: http://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/
Skript plus already adds support for this.
Not effectively though. Without reloading the skripts containing the bungee code, it "loses" connection after about ten minutes and all bungee cord functionality ceases to work (such as sending players from server to server)
It would be cool for Skript to hook into BungeeCord, perhaps add a few events like teleporting players to other servers or sending messages to all servers, and conditions like checking if the server is online. Maybe something to get a list of all players on a specificed server as well?
I could use this to show a list of servers, and set a variable whether a server is online or not. Depending on the outcome, I could show "Online" or "Offline". I could move players to other servers and make custom commands to have users switch servers.