Updated:

Spawn mobs game rule (spawn_mobs)

The "Spawn mobs" rule is called spawn_mobs in Java 1.21.11 and later, and doMobSpawning in 1.21.10 and earlier. Controls whether mobs spawn naturally.

Basic data

NameSpawn mobs
Rule name (Java 1.21.11+)spawn_mobs
Old name (Java 1.21.10 and earlier)doMobSpawning
Bedrock namedomobspawning
Value typetrue / false
Defaulttrue

Commands you can copy

Turn off (false)

/gamerule spawn_mobs false

Reset to the default (true)

/gamerule spawn_mobs true

Check the current value

/gamerule spawn_mobs

Java 1.21.10 and earlier

/gamerule doMobSpawning false

Bedrock Edition

/gamerule domobspawning false

Notes

Questions

Typing doMobSpawning gives an error

In Java 1.21.11 and later the rule is called spawn_mobs. Write /gamerule spawn_mobs … instead. Worlds on 1.21.10 and earlier keep the old name.

How do I check the current value?

Run /gamerule spawn_mobs without a value. The current value is shown in chat.

Other game rules