Updated:
The command
| Version | Command |
|---|---|
| Java 1.21.11+ | /gamerule minecraft:mob_griefing false |
| Java 1.21.10 and earlier | /gamerule mobGriefing false |
| Bedrock | /gamerule mobgriefing false |
Set it back to true to undo. It applies to the whole world and every player in it.
What it stops
- Creeper, ghast and wither explosions no longer break blocks (they still hurt you)
- Endermen stop picking up blocks
- Zombies stop breaking wooden doors
What it also switches off
The rule covers mobs touching blocks and items in general, so useful behavior stops too.
- Villagers stop farming: farmer villagers no longer harvest or plant, so villager crop farms stop.
- Sheep stop eating grass: sheared sheep do not regrow wool.
- Mobs stop picking up items: for example, piglins ignore gold on the ground.
Think about villager farms and wool machines before turning it off.
TNT is not included
TNT still explodes with mobGriefing off. On Bedrock, /gamerule tntexplodes false stops TNT. See the TNT guide.
Protect only one area
Game rules cannot target an area. To keep a base safe, stop hostile mobs spawning there with light (see stop mobs spawning). Servers usually use a protection plugin for areas.
When it does not work
- Error on 1.21.11+: the name is now
minecraft:mob_griefing. - Blocks still break: check whether it was TNT, a bed or another non-mob explosion.
- Villagers stopped working: that is this rule. Set it back to true if you need them.
Common questions
- Does it stop explosion damage? No, only block damage. For no damage, see invincibility.
- On a server? Run it as an operator or from the console. It is saved with the world.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.