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.
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.
You can also make the super fast command block clock but you have to change the
doTileDrops gamerule to
Here are the brief steps to spawn a zombie.
Place a command block on the ground.
set the following command:
summon Zombie ~ ~2 ~
This will make the zombie spawn 2 blocks on top of the command block.
This method makes only zombies spawn naturally, but they can also be spawned using spawner blocks or mob eggs.
- Make a redstone clock set to 8 ticks.
- Create the team: NoKill
- Make a second redstone clock on 4 ticks, then put in the command:
/scoreboard teams join NoKill @a
Enter the command into the first command block you placed:
Hope this helps!
/scoreboard objectives add selector dummy
/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.
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):
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]
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.