Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

Disabling the spawning of hostile mobs

  • Please log in to reply
4 replies to this topic



Posted 09 January 2013 - 12:09 AM

Hey guys,

Me and my modding crew are making a mod, that will have a map to go along with it. However, we were hoping to get all hostile mobs to not spawn. Since I am not comfortable with editing all that base code, I was wondering if there was a way to use the command block to make all hostile mobs not spawn.

I do know there is the gamerule:

/gamerule doMobSpawn

but that would disable the non-hostile mobs from spawning as well.

Is there a solution to my problem?

Thanks guys!


Register or log in to remove.


  • Minecraft: WuffelleffuW

Posted 09 January 2013 - 12:24 AM

I know I'm probably missing something here, but... turn the difficulty to peaceful? ^^



Posted 09 January 2013 - 12:30 AM

Well, yes. :P

However, we can't trust that the person using the map would turn it off.

Any other solutions?

If that's it, then that's just fine. Thanks for your help.


  • Minecraft: WuffelleffuW

Posted 09 January 2013 - 12:46 AM

Just let them spawn above a pressure plate triggering a commandblock with "/difficulty peaceful" or "force" them to walk over it at the beginning by putting the pressure plate into a narrow corridor.

I'm afraid if the user turns the difficulty up again afterwards there's nothing you can do (aside from making them walk over such commandblocks again and again.) Some people need to learn it the hard way. Posted Image



Posted 09 January 2013 - 12:56 AM