Minecraft – How to spawn ONLY zombies in Singleplayer

minecraft-java-edition

I'm making a maze where you have to fight zombies and get to the end, but all these other mobs start showing up and I can't figure out how to spawn only zombies. Also, I can't use dispensers.

Best Answer

Here are the brief steps to ensure only zombies and players live.

(Thanks Unionhawk for pointing out my mistake in the first answer and providing suggestions on this answer!)

  1. Make a redstone clock.

  2. Connect 4 command blocks into the redstone clock.

  3. Insert these commands into the command blocks:

    kill @e[type=Skeleton]
    
    kill @e[type=Creeper]
    
    kill @e[type=Enderman]
    
    kill @e[type=Spider]
    

    3.5 If you are in a superflat world you may want to add a kill Slime command.

  4. Remember to activate these command blocks at the same time.

  5. Activate the redstone clock.

  6. Done.

You can also make the super fast command block clock but you have to change the doTileDrops gamerule to false.


Here are the brief steps to spawn a zombie.

  1. Place a command block on the ground.

  2. set the following command:

    summon Zombie ~ ~2 ~
    
  3. Activate it.

This will make the zombie spawn 2 blocks on top of the command block.