Is there a command to stop individual mobs from spawning in Minecraft?

I want to be able to play survival mode on 1.8.0(with mods) without hostile mobs spawning but with hunger going down. Basically, I want the mobs to act like peaceful mode, but everything else to act like normal mode.


Found on the wiki:

doMobSpawning — Whether mobs should naturally spawn

=> /gamerule doMobSpawning false

There is no command to disable spawning of a specific mob, nor all hostiles one; you might achieve your result with some server configuration.


Minecraft peaceful mode: spawn hostile mobs, give them creative mode AI

The answer to this question might be useful to you though.


It's not strictly ideal, but you could have a group of repeating commandblocks (1 for each mob to block) either setting the mob's AI to false (so they won't move/attack), or straight up killing them. If you didn't want the drops, you could tp them to some negative y-value such that they despawn before they die.

For example, stopping all Creepers from moving and attacking:

/entitydata @e[type=Creeper] {NoAI:1}

Also, "killing" all zombies:

/tp @e[type=Zombie] ~ -500 ~