BungeeCord Connect

Discussion in 'Spigot Plugin Development' started by Frealy1995, Jun 2, 2016.

  1. I using a /hub not connect. Console error not there is..
    Code (Text):

    public class BungeeCord implements CommandExecutor {
        public boolean onCommand(CommandSender sender, org.bukkit.command.Command cmd, String label, String[] args){
            Player player = (Player) sender;
            if(cmd.getName().equalsIgnoreCase("hub")){
               ByteArrayDataOutput out = ByteStreams.newDataOutput();
               out.writeUTF("Connect");
               out.writeUTF("Lobby");
               Bukkit.getMessenger().registerOutgoingPluginChannel(Main.plugin, "BungeeCord", out.toByteArray());
            }
            return false;
        }
    }
     
     
  2. Can you explain it a bit more please?
     
  3. What? Just so. No error. Only not connect BungeeCord server.
     
  4. You can also just do a player command: /server <server>
     
  5. I know. And no /server <name> Please private command.
     
  6. Well, when the player excecute the cmd /hub , the player also do /server <server> instead all of this:
    Code (Text):
     ByteArrayDataOutput out = ByteStreams.newDataOutput();
               out.writeUTF("Connect");
               out.writeUTF("Lobby");
               Bukkit.getMessenger().registerOutgoingPluginChannel(Main.plugin, "BungeeCord", out.toByteArray());
     
  7. Code (Text):
    Bukkit.getMessenger().registerOutgoingPluginChannel(Main.plugin, "BungeeCord", out.toByteArray());
    You have to send it through a Player object, I forgot the method tho.
     
  8. [​IMG]
     
  9. [​IMG]
     
  10. You have to remove that and instead that the player need to do the cmd /server <server> when he typ /hub!
     
  11. No! No! Normal connect! not player using command /server <name>
     
  12. Then I can't help you, srry