Force players to switch servers

Discussion in 'BungeeCord Plugin Development' started by Lyphiard, Aug 5, 2014.

  1. Sorry if this is a duplicate thread, but I could not find any solution to this after googling.
    Is there any way to have a bukkit plugin force a player to switch servers? I thought about using sudo and that returns a unrecognized command.
     
  2. Yeah you could use the BungeeCord messaging channel. Just make a void something like this and call it when you want to let the players switch the server;
    Code (Text):
        public void submitBungeeCordCommand(Player p) {
            ByteArrayOutputStream b = new ByteArrayOutputStream();
            DataOutputStream out = new DataOutputStream(b);
            try {
                out.writeUTF("Connect");
                out.writeUTF("lobby");
    //The Server name you want to connect the player to
            } catch (IOException localIOException) {
            }
            p.sendPluginMessage(this, "BungeeCord", b.toByteArray());
    }
    //edit But the simplest solution would be to simply look in this subforum and there it is : ;) http://www.spigotmc.org/threads/the-bungee-bukkit-plugin-messaging-channel.499/