Creating a list of player in the config

Discussion in 'Plugin Development' started by Vinnya124, Jan 3, 2015.

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

    Vinnya124

    Hi. I am making a court plugin and there is a jury part. You can join or leave the jury. There can be up to 20 jury members. How can I make the max number 20 and make the list. Here is what I have so far:

    Code:
    }else if(commandLabel.equalsIgnoreCase("jury")){
            @SuppressWarnings("unchecked")
            List<String> juryMembers = (List<String>)plugin.getConfig().getList("jury memebers");
            if(args.length == 0){
                player.sendMessage(ChatColor.RED + "Too few arguments!");
            }
            if(args[0] == "join"){
                juryMembers.add(player.getName());
            }else if(args[0] == "leave"){
                juryMembers.remove(player.getName());
            }else{
                player.sendMessage(ChatColor.RED + "/jury <join|leave>");
            }
        }
     
  2. Offline

    TopTobster5

    When they use 'join' check how long the juryMembers list is. If it is greater than or equal to 20, reject them. If not, add them to the list.

    Are you trying to add it to a config file as well?
     
  3. Offline

    Vinnya124

    @TopTobster5 Hi. Sorry for the delayed response. Yes I am trying to add it to a config file as well. I am kind of a noob so would I create a list and add or take them off this list?
     
Thread Status:
Not open for further replies.

Share This Page