Beginner · 1 block

Disable natural mob spawning

Bedrock-only use case: press once to stop natural mob spawning, useful for a lobby or build world.

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

What you need

Before placing the blocks

  • 1 Command Block
  • 1 button
  • Tell players that this rule affects the whole world

Expected result

Test after setup

The doMobSpawning rule changes to false, but entities that already exist are not removed.

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

Rule block — disable natural spawning

Attach a button to the Impulse Block and press it once. To enable spawning later, use /gamerule doMobSpawning true.

Command Block
Rule block — disable natural spawning
Impulse
Unconditional
Needs Redstone
0
gamerule doMobSpawning 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