Connecting a player to another server in a Bukkit Plugin (Bungee Cord)

Discussion in 'Plugin Development' started by Xx_LeetGamer_xX, Apr 26, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Xx_LeetGamer_xX

    I'm making a server with Bungee Cord on it and I want to be able to make a player connect to a server, I've tried this:

    Code:
    p.chat("/server sg");
    But it says unknown command, is there any way to do this?
     
  2. use the plugin channels to talk to bungeecord, bungeecord catches /server command before its arived on the server
     
    Xx_LeetGamer_xX likes this.
  3. Offline

    Xx_LeetGamer_xX

    Thanks, got it working with this:

    Code:
         Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
                         
        ByteArrayOutputStream b = new ByteArrayOutputStream();
        DataOutputStream out = new DataOutputStream(b);
                         
        try {
              out.writeUTF("Connect");
              out.writeUTF("sg");
         } catch (IOException ex) {
                             
         }
         p.sendPluginMessage(this, "BungeeCord", b.toByteArray());
     
  4. Offline

    coleryan104

    So with this you were able to go to a another server without being first logging in throught the bungee cord server?
     
  5. No, it is impossible to do this without connecting through bungee.
     
  6. Offline

    stuntguy3000

  7. Offline

    BENCLABSTER

    would you please paste more? I cannot seem to get this to work, and I really need this for a plugin :| ferrybig
     
Thread Status:
Not open for further replies.

Share This Page