Solved Getting all players on the server

Discussion in 'Plugin Development' started by finalblade1234, Jan 30, 2013.

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

    finalblade1234

    How to i get all the players that are on the server?
     
  2. Offline

    chasechocolate

    List<Player> = Bukkit.getOnlinePlayers();
     
    wreed12345 likes this.
  3. Offline

    techboy291

    getServer().getOnlinePlayers()
     
  4. Offline

    gomeow

    chasechocolate I believe it returns an array
    techboy291 it doesn't matter which one you use. With Bukkit. It is static, and you don't need to have an instance of the main class. With getServer(), you need an instance of the main class
     
  5. Offline

    finalblade1234

    bubblefat_ likes this.
  6. Offline

    Woobie

    Code:
    for(Player all : Bukkit.getServer().getOnlinePlayers())
    {
        all.something(something)
    }
     
    Xp10d3 likes this.
  7. Offline

    Sagacious_Zed Bukkit Docs

    You need to learn Java. With arrays you primarily use loops...

    that is perhaps the most misleading variabel name i have seen this week.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
    Xp10d3 likes this.
  8. Offline

    finalblade1234

    and why not learn it with the great comunity at bukkit?
    PS. i did read all the tutorials on bukkitWiki
     
  9. Offline

    gomeow

    The BukkitWiki doesn't teach you Java, it is expected you have some Javya experience before delving into making plugins
     
    Xp10d3 likes this.
  10. Offline

    techboy291

    I know that. I just put getServer() there to imply that getOnlinePlayers() is in the Server class.
     
Thread Status:
Not open for further replies.

Share This Page