Solved hidePlayers() method?

Discussion in 'Plugin Development' started by ZodiacTheories, Jun 21, 2014.

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

    ZodiacTheories

    Hi, so I am creating a plugin where if a Player right clicks a clock then all the Players in his/her world get vanished. I tried creating a List of players in that world and then using the hidePlayer() method. I got an error in the console that said something like:

    Code:
    java.util.ArrayList cannot be cast to org.bukkit.entity.Player
    which seems to me that I cannot hide a list of players in a method that only takes one player.

    All I want to know is if there is a hidePlayers() method or something like that.

    Thanks
     
  2. Offline

    NervousBrain

    You have to use a for-loop.
     
  3. Offline

    ArthurMaker

    use it to hide:

    Code:java
    1. for(Player p : Bukkit.getOnlinePlayers()) player.hidePlayer(p);


    and it to show:

    Code:java
    1. for(Player p : Bukkit.getOnlinePlayers()) player.showPlayer(p);
     
  4. Offline

    ZodiacTheories

  5. Offline

    Zupsub

    Using a Java IDE would you prevent from compiling, putting the jar in the plugins folder und restarting the server.;)
     
Thread Status:
Not open for further replies.

Share This Page