There's no safe way to keep cows. If i put them in a pen, they escape. If I put them in the pit they suffocate. Seems to happen more when loading the world, but I think it's not limited to that. Maybe loading/unloading the chunk due to distance will cause it too.
I have a square pen with 10x10 fence, and roughly around 20 cows. I wouldn't say that is overfilled. Not even close to overfilled. Cows just push each other until they clip out.
If I put them into a 10x10x2 pit, they push into the wall until they suffocate. I think it's the same "clipping" problem.
Entities like cows should never clip into walls/fences to begin with, because once they are in, they will just try to auto-fix by going out in any direction. I think it's possible the entities are moving before the chunk is fully rendered? In that case it would be better to restrict movement until the chunk (and the 8 adjacent ones) are rendered.
I have a square pen with 10x10 fence, and roughly around 20 cows. I wouldn't say that is overfilled. Not even close to overfilled. Cows just push each other until they clip out.
If I put them into a 10x10x2 pit, they push into the wall until they suffocate. I think it's the same "clipping" problem.
Entities like cows should never clip into walls/fences to begin with, because once they are in, they will just try to auto-fix by going out in any direction. I think it's possible the entities are moving before the chunk is fully rendered? In that case it would be better to restrict movement until the chunk (and the 8 adjacent ones) are rendered.
PS: This happens on a single player world.