Keep chunks and entities loaded as if a player was there

Discussion in 'Spigot Plugin Development' started by Jalau, May 14, 2016.

  1. So I'm trying to keep a chunk loaded as if a player was in there. And I also want spigot to NOT slow down entities in that chunk because there is the feature that spigot slows down entity ticking if no player is near it.
    I have a custom entity in the chunk and maybe it is possible to make it keep the chunk loaded? Does anyone know a solution? Yes I can cancel the chunk unload event but the other entities would still get slowed down by spigot etc.
     
  2. Manually tick the entity.
     
  3. 1) on tick, check the entity's adjacent chunks (all 8) and load them if they are unloaded.
    2) on chunk unload event check if entity is in that chunk, or any adjacent chunks (all 8) and cancel if its there.

    This will ensure the chunks where the entity is and might walk to are loaded always.

    As for making it not slow down the entity ticks, idk. Check previous comment for possible solution ;)
     
    • Informative Informative x 1