Solved String to player

Discussion in 'Plugin Development' started by The Fancy Whale, Jul 13, 2014.

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

    The Fancy Whale

    Now that you can't use Bukkit.getPlayer(string) the only way I can think of doing this would be:
    Code:java
    1. for (Player p : Bukkit.getOnlinePlayers()){
    2. if (p.getName().equals(string){
    3. //do whatever with player p
    4. }
    5. }

    Anyone know a better way of doing this?
     
  2. Offline

    Gerov

  3. Offline

    teej107

  4. Offline

    1Rogue


    That's a great way to have bugs


    Bukkit.getPlayer(String) is still perfectly usable.
     
  5. Offline

    The Fancy Whale

    Gerov teej107 1Rogue Whoops, misplaced a parenthese... Probably should have read the error message. It turned out to be reading a boolean, not a string because of it. Thanks for the help!
     
Thread Status:
Not open for further replies.

Share This Page