The Mob Object Mod lets you turn on and shut off the movement of mobs by the use of two different items. You can freeze and unfreeze their movements at your will. So instead of having to build a fence to make sure your cattle don’t run away you can you these items to freeze them to their position.
There are two items which you can use to freeze and unfreeze the movement of mobs. Simply tap on the mob with either of the two items to toggle their movement.
Once you’ve frozen a mob it will remain frozen until it’s unfrozen. You can exit a world and return to it and it will still remain frozen.
Here’s a short video demonstrating how it can be used in-game. In this case, I spawned two zombies, froze them and then set the gamemode to survival. As you can see, they didn’t touch me until I unfroze them.