1.14.4 how much impact has chunk.isLoaded()?

Discussion in 'Spigot Plugin Development' started by ENCOM, Mar 9, 2020.

  1. hi there,

    i'm coding a fancy crate plugin (with particles and that fancy stuff).

    now, since i want the plugin to support multiple crates and unlimited placements, i want to keep in check the
    impact on the servers. im using a bukkit scheduleTask to spawn 5-10 particles every 10-20 ticks.

    someone recommended me to disable it when the chunk is not loaded/no players can acces the crate(s)

    i added "chunk.isLoaded()" to the task but i am not sure if this is better than just letting particles spawn.

    there are crates which spawn automated and 20-60 crates at the same time are placed in the worlds

    EDIT:
    tried another method which seems t be a better option than "chunk.isLoaded()"
    Code (Java):
    world.isChunkLoaded(chunkX, chunkZ)
     
    #1 ENCOM, Mar 9, 2020
    Last edited: Mar 9, 2020