Beginner · 1 block

Test your first Command Block

Press a button and make the Command Block announce a chat message. A quick check that settings and permissions work.

Choose in-game screen
Java Edition Bedrock Edition
Java Edition 1.21.5 and up

What you need

Before placing the blocks

  • 1 Command Block
  • 1 button or lever

Expected result

Test after setup

When the button is pressed, everyone sees “Command Block is working” in chat.

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

Main block — announce on press

Attach a button to the side of the Command Block and match these settings.

Set Console Command for Block
say Command Block is working

@s = self · @p = nearest player · @a = all players · @e = all entities

Previous Output-
Impulse Unconditional 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