Join event

Discussion in 'Plugin Development' started by gban, Mar 16, 2019.

  1. Offline


    I'm making a UHC plugin and im adding users to a list upon join if the game hasn't started, but even if the user is in the arraylist it still doesn't let them join

        ArrayList<Player> users = new ArrayList<Player>();
        public ArrayList<Player> getUsers() {
            return users;
         if (!uhc.getGameManager().isStarted()) {
                if (!uhc.getUsers().contains(player)){
                    player.kickPlayer(ChatColor.RED + "Game already started! \n Check to view upcoming matches!");
  2. @gban
    the getUsers() function returns a copy of that array, so adding them to that would be useless as it wouldn't save. The best option is to add a new function in the class with the arraylist that handles adding them to the list.

Share This Page