Beginner · 1 block

Protect builds from mob griefing

Press a button to turn off mobGriefing, stopping mobs such as Creepers and Endermen from changing or destroying blocks.

Choose in-game screen
Java Edition Bedrock Edition
Bedrock Edition (stable)

What you need

Before placing the blocks

  • 1 Command Block
  • 1 button
  • Cheats enabled or Operator permission

Expected result

Test after setup

Mobs can no longer change or destroy blocks through behavior controlled by this rule, while players can still build and mine normally.

Configure one block at a time

Open the game and match these values

The copy button copies only Command Input. Choose every other value in the Command Block screen.

1

Block 1 — turn off mobGriefing

Attach a button to the Impulse Block and press it once. To restore the rule later, use /gamerule mobGriefing true.

Command Block
Block 1 — turn off mobGriefing
Impulse
Unconditional
Needs Redstone
0
gamerule mobGriefing false
Previous Output
-
Block Type:
Impulse
Condition:
Unconditional
Redstone:
Needs Redstone

If it does not work

Check these four things first

  1. Cheats are enabled and you have Operator permission
  2. Needs Redstone or Always Active matches the example
  3. Chain Block arrows face the same direction and follow the previous block
  4. Read Previous Output to find the command that failed
Read the Command Block basics