Minecraft – way to prevent animals from escaping a fenced area

minecraft-java-edition

It seems that animal mobs (sheeps, cows, pigs) are trying to break out of my fence instead of going in the middle and moving around. This makes it really frustrating when trying to mate the animals because they break out right when I open the fence gate. Is there a way that I can keep them from scrunching up on the side of the fence and frustrating me, or is this something I'll have to deal with?

Best Answer

There are only a handful of things that can compel a passive mob to move in a specific direction:

  • Light, so if your pen is dark they may be moving towards lighter areas.
  • Grass, so if your pen floor only has dirt or stone they may be moving towards "greener pastures". This could easily happen with sheep, since they eat the grass and it needs time to grow back.
  • Wheat, so if you're holding wheat you need to switch to another item to safely get in your pen gate.