You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Babies will no longer spawn in walls and instead spawn under the mother. The mother should be in a safe place to spawn. It also simulates the animals coming from the mother and not just spawning around the mother.
The text was updated successfully, but these errors were encountered:
Have you actually tried doing this? The last time I checked mobs really don't do well when they are immediately on top of each other. Either they are stuck together and you can't really separate them, or the moment one moves the other goes flying off into the distance because of the collision physics.
Kittychanley
changed the title
[Suggestion] Animals born in walls
Animals born in walls
Dec 28, 2015
I've been using this in my addon and I've yet to have any issues with it. It actually works better than expected. If you want to test the behavior for yourself, just grab a spawn egg and spam right-click on a block. I thought I should suggest this since it is such a simple fix that works great and fixes an annoying problem.
I noticed a little bug where animals spawn in walls, fences, etc.
In an animals OnLivingUpdate method (cow, deer, horse, pig, sheep, wolf), if you set:
baby.setLocationAndAngles(posX + (rand.nextFloat() - 0.5F) * 2F, posY, posZ + (rand.nextFloat() - 0.5F) * 2F, 0.0F, 0.0F);
to
baby.setLocationAndAngles(posX, posY, posZ, 0.0F, 0.0F);
Babies will no longer spawn in walls and instead spawn under the mother. The mother should be in a safe place to spawn. It also simulates the animals coming from the mother and not just spawning around the mother.
The text was updated successfully, but these errors were encountered: