How do you spawn ONLY zombies in Singleplayer?
Emma Newman
Published Jul 13, 2026
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.
55 Answers
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!)
Make a redstone clock.
Connect 4 command blocks into the redstone clock.
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.
Remember to activate these command blocks at the same time.
Activate the redstone clock.
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.
Place a command block on the ground.
set the following command:
summon Zombie ~ ~2 ~Activate it.
This will make the zombie spawn 2 blocks on top of the command block.
5To spawn a zombie with a command block, type in the command:
/summon Zombie X Y ZReplace X Y Z with the coordinates of where you want to spawn the zombie.
4Setup:
/scoreboard objectives add selector dummyClock(20tps)
/scoreboard players set @e selector 1
/scoreboard players set @e[type=<Type>] selector 0//One of these per entity type, in this case one for zombie and one for players
/tp @e[x=<X>,y=<Y>,z=<Z>,r=<Range>,score_selector_min=1] ~ ~-600 ~First it marks all entites, then unmarks the selected entite(s), and finally teleports the marked entites down into the void so there is no dying animation and no items drop.
Use a command block to set certain gamerules. If you program one with this command,
/gamerule doMobSpawning false
then mobs can only spawn if you spawn them in with /summon, a spawn egg, a dispenser, etc.
Method #1:
You can do this by auto-killing all hostile mobs that are not Zombies - Plug in Command blocks with these commands into a fast Redstone clock (or use the 1.9 Command Block fetures):
/kill @e[type=Spider]
/kill @e[type=Enderman]
/kill @e[type=Creeper]
/kill @e[type=Skeleton]
/kill @e[type=CaveSpider]
/kill @e[type=Witch]
/kill @e[type=Slime]
/kill @e[type=Guardian]
Method #2 (the hardcore one):
When a non-Zombie hostile mob spawns, replace it with a Zombie - Again, on a fast RS clock plug Command blocks with these commands:
/execute @e[type=Spider] ~ ~ ~ summon Zombie ~ ~ ~
/execute @e[type=Enderman] ~ ~ ~ summon Zombie ~ ~ ~
/execute @e[type=Creeper] ~ ~ ~ summon Zombie ~ ~ ~
/execute @e[type=Skeleton] ~ ~ ~ summon Zombie ~ ~ ~
/execute @e[type=CaveSpider] ~ ~ ~ summon Zombie ~ ~ ~
/execute @e[type=Witch] ~ ~ ~ summon Zombie ~ ~ ~
/execute @e[type=Slime] ~ ~ ~ summon Zombie ~ ~ ~
/execute @e[type=Guardian] ~ ~ ~ summon Zombie ~ ~ ~
And, if any of these Command blocks has a positive output, trigger a Command block with this command (using a Comparator):
/execute @e[type=Zombie] ~ ~ ~ kill @e[type=!Zombie, r=2]
Note: the r=2 is important, because if the mob would move when spawned and the command would be r=1, it wouldn't get killed, just moved - many mobs would spawn.
Note: You can redo this to the 1.9 Command block structure.