Loop through players except certain players.

Discussion in 'Plugin Development' started by BetaNyan, Aug 2, 2014.

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


    I am making a plugin a 1v1 plugin and when the 1v1 starts, I want all players that are not in the 1v1, to not be able to see the players in the 1v1, and the players in the 1v1, can only see each others.
    Here is my code
    1. for(Player online : Bukkit.getServer().getOnlinePlayers()) {
    2. online.hidePlayer(plz);
    3. online.hidePlayer(p);
    4. if(!(battle.containsKey(online))) {
    5. plz.hidePlayer(online);
    6. p.hidePlayer(online);
    7. }
    8. if(!(battle.containsValue(online))) {
    9. plz.hidePlayer(online);
    10. p.hidePlayer(online);
    11. }
    12. }

    What can I do?
  2. Offline


    You can vanish everyone and then unvanish that 1 player?
  3. Offline


    DERP. Thank you!
Thread Status:
Not open for further replies.

Share This Page