Solved Checking if any players are in a specific world

Discussion in 'Plugin Development' started by KarimAKL, May 28, 2018.

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

    KarimAKL

    Okay so i want to check if there is any players in a specific world before doing something and i have this:
    Code:Java
    1.  
    2. if (plugin.getServer().getWorld("world").getPlayers() > 0) {
    3. //Do something
    4. }
    5.  

    but it comes with this error: "The operator > is undefined for the argument type(s) List<Player>, int"
    I don't understand why this doesn't work. :7
     
  2. Offline

    timtower Ninja on the waves Moderator

    @KarimAKL You are using a greater then operator on a list.
    You need to call .size() or .empty()
     
  3. Online

    KarimAKL

  4. Offline

    MightyOne

    That's java not bukkit
     
Thread Status:
Not open for further replies.

Share This Page