Hello, I'm working on a bug in my mod and found a behavior that seems really weird.
My mobs need custom spawning behavior in the world. I'm doing the logic to determine spawning is the getCanSpawnHere method. To my understanding, it returns whether the mob can spawn at the given spot, and if it returns false, then the mob spawn is cancelled.
I was debugging some code where my mobs were spawning everywhere, but getCanSpawnHere is supposed to only let them spawn near villages. All of my logic looked correct, but even when the method returns false mobs still spawn. This results in mobs spawning even away from villages. I even explicitly tried putting return false so the mobs theoretically can't spawn. But they still are spawning even when getCanSpawnHere returns false!
So how should I properly use getCanSpawnHere? It seems to be not working. Thanks.
Code
getCanSpawnHere method
Register entity
Register spawn
All files
Thank you!