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


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


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


  4. Offline


    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


    bubblefat_ likes this.
  6. Offline


    for(Player all : Bukkit.getServer().getOnlinePlayers())
    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


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


    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


    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