Solved How to separate players in a list

Discussion in 'Plugin Development' started by Pacothegint, Nov 19, 2014.

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

    Pacothegint

    My code finds all players that are in a certain group.
    Code:java
    1. for(Player player:Bukkit.getOnlinePlayers()){
    2. if(plugin.permission.playerInGroup(player, string)){
    3. players.add(player.getName());
    4. }
    5.  

    How can I get the names of all the players?
    instead of just one?
     
  2. Offline

    Googlelover1234

    Pacothegint
    Couldn't you just loop through all of the players who have permission?
     
  3. Offline

    Pacothegint

    Googlelover1234
    I think I tried that maybe. The end result was just the same name over and over.

    I've got the problem mostly solved.
    I just don't know how to split the list into different strings of player names.
    for example this is what i want it to do
    Code:
    owner
     
    player1
     
    player2
     
    player3
    
    what it does
    Code:
    owner
     
    player1
     
    player1
     
    player1
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
Thread Status:
Not open for further replies.

Share This Page