add multiple players to team

Discussion in 'Plugin Development' started by amatokus, Jul 6, 2014.

Thread Status:
Not open for further replies.
  1. Hi!

    I have an Arraylist but I can't figure out how to add to full list to a team:

    For example I have this list:

    Code:
    list1:
        -a
        -x
        -y
        -z
    These are the player names.

    And I would like to add all these to a team. But how? :/
     
  2. Offline

    unrealdesign

    Code:java
    1. for(String pName : config.getList(path))
    2. {
    3. Player p = Bukkit.getPlayerExact(pName);
    4. team.add(p);
    5. }
     
    amatokus likes this.
  3. unrealdesign Thank You! +1 like :p

    Edit: It's not ".add()" but ".addPlayer()"
     
  4. Offline

    unrealdesign

    I wans't sure if Team was your own class or bukkit, so I was just making it obvious that at that point, you add the player to whatever you're trying to add him to :)
     
Thread Status:
Not open for further replies.

Share This Page