Intermediate · 2 blocks

Diamond and speed reward button

Press a button to give the nearest player one diamond, then apply Speed from a Chain Block.

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

What you need

Before placing the blocks

  • 2 Command Blocks
  • 1 button
  • Place both blocks with their arrows forming one chain

Expected result

Test after setup

The nearest player receives 1 diamond and Speed I for 10 seconds.

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 — give a diamond

Attach the button to the first Impulse Block.

Set Console Command for Block
give @p minecraft:diamond 1

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

Previous Output-
Impulse Unconditional Needs Redstone
2

Block 2 — apply Speed

Set the Chain Block to Conditional so it runs only when giving the diamond succeeds.

Set Console Command for Block
effect give @p minecraft:speed 10 0 false

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

Previous Output-
Chain Conditional 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