-3

I tried using /gamemode doMobSpawning false, but it said it was invalid. What do I do?

  • It's been a while, but I believe if you play on "Peaceful" difficulty, no hostile mobs will spawn. Pigs and sheep etc. will still spawn however. Additionally, while you can't die of starvation in peaceful, you still can lose health if you don't eat regularly enough. – Ben Oct 17 '16 at 1:44
  • Additionally, doMobSpawning is not a gamemode - which is why that command didn't work. Gamemode only has 3 commands 0, 1, and 2, which I believe is Creative, Survival, and Adventure. – Ben Oct 17 '16 at 1:47
  • 1
    As @Ben said, doMobSpawning is not a gamemode. It is actually a gamerule. Just replace "gamemode" with "gamerule". – TheVoidChaos Oct 17 '16 at 1:59
5

To remove all mobs (other than player-placed ones, such as armor stands), simply use the mob spawning gamerule.
I don't know why Minecraft seems to be spitting out errors, but what you've typed seems to be correct. Are you perhaps using a version of Minecraft prior to 1.4.2?

/gamerule doMobSpawning false

If you do not want to have to worry about hunger, simply have a command block on loop running this command:

/effect @a minecraft:saturation 2 10

Alternatively, peaceful difficulty does the above, only that it still allows peaceful (animals) to spawn.

/difficulty 0
| improve this answer | |
  • 1
    He was using /gamemode, instead of /gamerule. – TheVoidChaos Oct 17 '16 at 4:22
  • @TheVoidChaos Right. I'm blind. :P – aytimothy Oct 17 '16 at 4:51
0

As shown above by @TheVoidChaos and @aytimothy, you are using /gamemode instead of /gamerule. Use /gamerule.

| improve this answer | |
-2

Turn off Mobs Option for Creative Mode. Put down a command block, enter /gamerule doMobSpawning false, and turn it on with a lever.

| improve this answer | |
  • Or you could just type it into the chat box. – aytimothy Oct 19 '16 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.