Solved Get all Loaded Chunks

Discussion in 'Plugin Development' started by Rift_Blade, Oct 6, 2017.

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

    Rift_Blade

    Hello i am working on a plugin and i need to get all loaded chunks, the only way i know how to get loaded chunks is getPlayer().getWorld().getLoadedChunks() or another way that uses getWorld, i want to Get all loaded chunks from ALL worlds not just one world
    Any help is appreciated
     
  2. Offline

    Zombie_Striker

    @Rift_Blade
    For loop through all the worlds before calling getLoadedChunks.
     
  3. Offline

    Rift_Blade

    How would I get all worlds, can you show some example code
     
  4. Offline

    Zombie_Striker

    @Rift_Blade
    Use Bukkit.getWorlds() to get a list of all the worlds, and then use a for-each loop to loop through them.
     
  5. Offline

    Rift_Blade

    Look I'm a bit of a plugin noob, this is my second plugin, can you provide example code
     
    Last edited: Oct 6, 2017
  6. Offline

    Mariuslbis

    for (World w : Bukkit.getWorlds(){
    w.getLoadedChunks();
    }

    Try that,i wrote it on my phone so
    It is not tested but it should work.

    Sendt fra min HTC Desire 626 med Tapatalk
     
  7. Offline

    Rift_Blade

    it says "cannot resolve symbol 'w'"
     
  8. Offline

    timtower Administrator Administrator Moderator

  9. Offline

    Mariuslbis

    Try this i forgot a parentense

    for (World w : Bukkit.getWorlds()){
    w.getLoadedChunks();
    }
     
  10. Offline

    Rift_Blade

    Thanks that fixed it
     
  11. Offline

    Mariuslbis

Thread Status:
Not open for further replies.

Share This Page