How do I disable or enable mob griefing on my Minecraft server?
In this article
Mob griefing is the collective name for everything mobs can change about the world: a creeper blowing a crater in your house, an enderman taking a block out of your wall, a zombie breaking down a wooden door, sheep eating grass, villagers harvesting crops. One gamerule turns all of that off: mobGriefing. On building servers and servers with young players it is often the first setting you change.
From the panel console
- Go to the game panel and click your server.
- Open the Console tab.
- Type
gamerule mobGriefing falseand press Enter. - The console confirms: Gamerule mobGriefing is now set to: false.
Turn it back on with gamerule mobGriefing true. In-game you use the same command with a slash in front; for that you need to be OP.
What exactly changes?
- Creepers still explode and still damage players, but no longer destroy blocks.
- Endermen no longer pick up or place blocks.
- Zombies no longer break doors and ghast fireballs no longer damage blocks.
- Ravagers do not trample crops, sheep do not eat grass and snow golems leave no snow trail.
- Wither explosions do not damage blocks; the Ender Dragon still destroys blocks (that falls under a different rule).
The pitfall: villagers and farms
Mob griefing also covers villagers. With the rule set to false, villagers can no longer harvest and plant crops, so every automatic farm that relies on them stops. Villager breeders that need food from a farmer also grind to a halt. On a survival server with experienced players that leads to complaints that seem to have nothing to do with griefing. The fix depends on your server software:
- On Paper and Purpur you can exempt specific mobs in
paper-world-defaults.yml(or per world) underentities.behavior, for example blocking creepers while letting villagers harvest. - With WorldGuard you set
creeper-explosion denyandenderman-grief denyper region while the gamerule staystrue, so villagers keep working. - On vanilla there is no middle ground: it is all or nothing.
Disabling creepers only
If you only want rid of creeper holes and keep everything else normal, a plugin is the better route. WorldGuard (with the global region) or a lightweight plugin that only blocks creeper explosions keeps the rest of the mob mechanics intact. On Purpur it can also be done per mob in purpur.yml.
Is the setting saved?
Yes. Gamerules live in the world file and survive restarts and version updates. They are per world, though: on a server with several worlds you set the rule in each world separately, or use a plugin that manages gamerules centrally. To check the current value, type gamerule mobGriefing without a value in the console.
Related settings
- Disabling TNT explosions — TNT is not covered by mobGriefing.
- Disabling fire spread — for fire that spreads.
doMobSpawningif you do not want mobs to spawn at all.
Not behaving as expected, for example on a modpack server where a mod adds its own rules? Open a ticket and we will take a look.
Launch your server in 60 seconds on our own hardware.