#Stopping entity from unloading

1 messages · Page 1 of 1 (latest)

chilly ermine
#

I have an entity which I do not want to be unloaded, I have checked the EntitiesUnloadEvent however it seems as if that is not cancellable and you can't exclude certain entities from being unloaded, exact same for ChunkUnloadEvent, now WorldUnloadEvent can be cancelled but that' not what I want, should I just try to reload the entities once their chunk unloads?

tame comet
random rune
#

wouldn't that technically cause weird issues n memo leaks

#

Like keeping a world in memory forever because of that 1 entity

#

I'd rather recreate the entity like all other entities have always done

chilly ermine
#

Well, I could use force-loaded chunks

valid meadow
#

I really want to know why you don't want this entity to be unloaded

chilly ermine
#

It's part of what I like to call "an entity amalgamation", if said entity is unloaded I could either store the chunk and load it once I need to move the entire "amalgamation" or stop it's chunk from unloading

#

Basically it would cause desyncs if the entity is unloaded and anything tries to happen with the "amalgamation"

valid meadow
#

Then I would say just forceload the chunks around the "entity amalgamation"
And un-forceload them once it leaves. (don't forget to keep the previous foce loaded state so you accidentally un-forceload something else)

chilly ermine
#

Oh well that's handy

#

I'll figure the force loading in a bit