Creating new method in config (need help again)

Discussion in 'Plugin Development' started by dajako, Aug 28, 2013.

Thread Status:
Not open for further replies.
  1. In the post from earlier where I put "teamname" now needs replacing with an actual team name. I want people to be able to create their own team names but I don't know how I would change the "teamname" method or whatever it's called to this argument in a command.

    -----------------

    So I have a config file, it looks like this:
    Code:
    team:
      teamname:
      - name1
      - name2
    I have sorted out the writing but now I need to check if the player's name is in the list. How can I do this?

    Thanks in advance for any replies!
     
  2. dajako
    Code:
    if(getConfig().getStringList("team.teamname").contains(name) { }
     
    dajako likes this.
  3. Awesome thanks!

    Ah, just came across another issue, I have no idea about how I could add the team name there if it isn't already created. How could I put team names there?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
Thread Status:
Not open for further replies.

Share This Page