connect to any hub server with /hub command

Discussion in 'BungeeCord Plugin Development' started by parpar8090, Aug 12, 2021.

  1. Hello, I'm currently making a Minigame plugin for my network and I want to connect the player to any of the hub servers when running the command /hub

    How can I do so?

    This is my code:
    Code (Java):
        protected void onCommand() {

            BungeeUtil.connect(getPlayer(), "hub");
            //todo instead of "hub", find ANY hub server that is not full
    NOTE: I use this method from the Foundation API to connect the player
  2. Use channel message