How do you spawn ONLY zombies in Singleplayer?

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!)
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.
Pictures about "How do you spawn ONLY zombies in Singleplayer?"



Quick Answer about "How do you spawn ONLY zombies in Singleplayer?"
What is the command to spawn zombies on player?
How to Enter the CommandHow do you force a zombie to spawn?
the command /testfor would help you, it use to detect player and activate commands. Also you can use /summon zombie @p ~ ~ ~ To summon a zombie (or multiple) directly on the player closest to command block.How do you spawn zombies near player?
In Minecraft, there is a spawn egg called Zombie Spawn Egg that is blue with green spots. This spawn egg is an item that can not be crafted in the game. It is only available in Creative mode (not Survival mode) through the Creative Inventory menu. When you use this spawn egg, it will instantly spawn a zombie.How to spawn only zombies in Minecraft! | Force kill with commands
More answers regarding how do you spawn ONLY zombies in Singleplayer?
Answer 2
To spawn a zombie with a command block, type in the command:
/summon Zombie X Y Z
Replace X Y Z with the coordinates of where you want to spawn the zombie.
Answer 3
Setup:
/scoreboard objectives add selector dummy
Clock(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.
Answer 4
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.
Answer 5
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.
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: George Dolgikh @ Giftpundits.com, George Dolgikh @ Giftpundits.com, George Dolgikh @ Giftpundits.com, Tima Miroshnichenko