In order to have a proper ‘zoo’ of mobs, you need to stop them de-spawning. In the case of Zombies, (as @MrLemon pointed out) simply throwing an item at them and letting them pick it up is enough to keep them spawned.
How do you stop mobs from entering?
How to Stop Mobs Entering Your Home
- First dig out you space.
- If you want (you don’t have to) fill the bottom with something.
- Place a sign on the block in the middle at one end.
- Crouch and place carpet of your choice on the signs.
- build a wall of some sort otherwise the mobs will just go around.
- You’ve finished!
How do you stop a mob from Despawning?
To stop a mob from despawning, you need to give it the PersistenceRequired NBT tag. You can do this when you summon the mob like this: /summon creeper ~ ~ ~ {PersistenceRequired:1b} Or by changing the mob’s data after summoning them:
Is there a way to stop a zombie from Despawning?
You rename them using the anvil, and then apply to given mob. Once named, the mob will not despawn. Of course, hostile mobs will remain hostile, mortal and in case of some, like creepers, suicidal, but at least they don’t despawn.
Is there a way to prevent animals in Minecraft?
As mentioned above, putting a light source in the center of the pen will attract them and keep them away from the edges. Alternatively, you can remove your gate, and replace that section of the fence with wood blocks however high your pen is.
What happens when you spawn a hostile mob in Minecraft?
Of course, hostile mobs will remain hostile, mortal and in case of some, like creepers, suicidal, but at least they don’t despawn. Additionally, you get monster’s name over their head. Or if you have cheats enabled, you can spawn a mob with the tag {PersistenceRequired:1} with command blocks that prevent the mob from despawning.