Get Players is ambiguous?

Discussion in 'Plugin Development' started by XxZHALO13Xx, Apr 15, 2015.

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

    XxZHALO13Xx

    Code:
    public int getPlayersOnline(){
           return Bukkit.getServer().getOnlinePlayers().length;
    
           }
        }
    Get online players has the error. I'm using craftbukkit 1.8. It worked perfectly fine on 1.7.9. Not sure if I have to use bukkit instead of craftbukkit. If so please show me how to get the bukkit instead of craftbukkit
     
  2. Offline

    I Al Istannen

    Last edited: Apr 15, 2015
  3. Offline

    XxZHALO13Xx

  4. Offline

    nverdier

    @XxZHALO13Xx #getOnlinePlayer()

    It returns a Collection<? extends Player> (assuming you're using Bukkit as the library and not CraftBukkit) which has a #size() method.
     
  5. Offline

    I Al Istannen

    @XxZHALO13Xx @nverdier Sorry, you are right. The Link to the docs is correct though. Thanks for pointing it out!
     
  6. Offline

    nverdier

Thread Status:
Not open for further replies.

Share This Page