Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by Xemor, Jul 8, 2021.
Hi, is ChunkLoadEvent the only way of listening for entities being loaded into the world?
There is an EntitySpawnEvent as well.
Does this work on mobs being reloaded after a restart?
Ah yea; no, I do not believe it would.
Load + spawn being paired should be enough to notice every entity being loaded in.
I'm getting an issue where the e.getChunk().getEntities() array is always empty?
There was a bug fix for this a while ago, go update Spigot or w/e you use.
This is a known bug in spigot 1.17. There is a PR open which fixes this and also adds new Entities(Un)LoadEvent and methods. You can either wait for it to be merged or create a schedular in the ChunkLoadEvent which runs a few ticks later and do then the entity logic.
You use your ears boss man.