#Delete Entity in unloaded chunk
26 messages · Page 1 of 1 (latest)
It'll unload immediately after if you don't explicitly give it a reason to stay loaded with a ticket
World#getChunk
or just wait till that chunk is loaded by something else and remove the entity then, without loading chunks for nothing
(ServerChunkEvents#CHUNK_LOAD)
why no?
it's way better than loading chunks randomly
?
your code will not constanly run
and do you think it is better to load up to 200 chunk to remove them?
and?
you check if you have something for that chunk and do your cleanup
it will be way faster then what will happen when you load a chunk
because loading chunks is not something cheap
the two things are not on the same scale
because that's cheap
loading a chunk is not
you have what mc is doing while loading a chunk + whatever every loaded mod will do when a chunk is loaded
compare that to a map lookup
and you will see
it's your mod.
if it's just one time then you can just run a fixup script on the world files, no mod necessary
okay but why do that when Minecraft has all of the infrastructure for loading, modifying and saving world files
This doesn't seem particularly difficult from an idea standpoint
List all files in directory, load each one using an NBT parser, iterate over entities in list, delete ones matching two fields, then save
I suggest you try out one of the suggested approaches rather than focusing on whether one approach would be marginally better or worse than another