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:
but that would disable the non-hostile mobs from spawning as well.
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.