Intermediate · 2 blocks

Lock the world to daytime

Bedrock-only use case: press once to set daytime, then stop the day-night cycle with a Chain Block.

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

What you need

Before placing the blocks

  • 2 Command Blocks
  • 1 button
  • Point the first block arrow into the Chain Block

Expected result

Test after setup

The world changes to daytime and time stops advancing until doDaylightCycle is enabled again.

Placement direction

Make every block arrow point in the same direction

1 Impulse 2 Chain

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 — set daytime

Attach the button to the first Impulse Block.

Command Block
Block 1 — set daytime
Impulse
Unconditional
Needs Redstone
0
time set day
Previous Output
-
Block Type:
Impulse
Condition:
Unconditional
Redstone:
Needs Redstone
2

Block 2 — stop the time cycle

Place a Chain Block after the first arrow and set it to Conditional and Always Active.

Command Block
Block 2 — stop the time cycle
Chain
Conditional
Always Active
0
gamerule doDaylightCycle false
Previous Output
-
Block Type:
Chain
Condition:
Conditional
Redstone:
Always Active

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