Skip to content
[/craft]

How to Use Command Blocks in Minecraft

A command block is a special block in Minecraft that runs a command automatically when activated by redstone or set to Always Active. To get one, enable cheats and run /give @p command_block. Place it, right-click to open its interface, paste your command without the leading slash, and activate it with a button or redstone signal.

Updated 2026-07-03|Java 26.2 + Bedrock 26.32

What is a command block?

A command block is a special block that stores and runs a Minecraft command automatically when activated. Unlike typing commands in the chat, a command block can be wired into redstone circuits, triggered by players stepping on pressure plates, or set to run continuously on every game tick.

Command blocks are invisible to survival players in normal gameplay -- they can only be obtained and used with operator permissions or cheats enabled. They are the backbone of adventure maps, minigames, and automated server events.

How to get a command block

Command blocks cannot be found in the creative inventory by default. To get one, make sure cheats are enabled and run:

/give @p command_block

This gives you an Impulse command block (the orange one). You can also get the other types:

/give @p chain_command_block
  /give @p repeating_command_block

On Bedrock Edition the item names are the same. Once you have one in your inventory, place it like any other block.

The three types of command block

Impulse (orange): Runs its command once each time it receives a redstone pulse. This is the standard type and the right choice for most uses.

Chain (teal/green): Runs after the command block pointing into it has run. Used to sequence multiple commands in order. A chain command block only fires if the block pointing to it succeeded.

Repeat (purple): Runs its command every game tick (20 times per second) as long as it is powered. Useful for continuous effects like weather locking or persistent effects, but use sparingly as it can impact server performance.

Opening and configuring the interface

Right-click (or long-press on mobile/console) a placed command block to open its interface. You will see:

Command input -- paste your command here. Do not include the leading slash; command blocks don't need it.

Block Type -- switch between Impulse, Chain, and Repeat.

Condition -- set to Conditional to only run if the previous block in the chain succeeded. Set to Unconditional (default) to always run.

Redstone -- set to "Needs Redstone" to require a signal, or "Always Active" to run immediately without redstone. Impulse blocks set to Always Active fire once when placed; Repeat blocks fire continuously.

How to activate a command block

The simplest way to trigger a command block is with a button:

1. Place a button on the side of the command block (or on an adjacent block connected by redstone). 2. Click the button. 3. The command block runs its command once.

For automated triggers, connect the command block to a pressure plate, tripwire, daylight sensor, or any other redstone source. For commands that should run continuously (like keeping the weather clear), use a Repeat command block set to Always Active.

Tips and common mistakes

No leading slash: In the chat you type /gamemode creative. In a command block, type gamemode creative (no slash). Adding the slash causes a syntax error on Java Edition.

Conditional chains: In a chain of command blocks, point each block into the next one (the arrow on the block shows the direction). If using Conditional mode, a failed command stops the whole chain.

Output: Command blocks show a "Last Output" message in their interface after firing, which tells you whether the command succeeded or what error occurred. This is your first debugging tool.

Cheats required: Command blocks work in survival worlds only if the world has cheats enabled or the server has operator commands enabled. Players who are not OP cannot interact with command blocks even if they can see them.

Frequently asked questions

Why isn't my command block doing anything?

Check these in order: (1) the block has a command entered (right-click to verify), (2) it is receiving a redstone signal or set to Always Active, (3) cheats or OP are enabled for the world, (4) the command has no syntax errors -- check the Last Output message in the block's interface.

Do command blocks work on Bedrock Edition?

Yes -- command blocks work on Bedrock 26.32 with the same three types (Impulse, Chain, Repeat). The interface is nearly identical to Java Edition. The main difference is that some commands have different syntax between editions.

Can command blocks work without redstone?

Yes -- set the command block to "Always Active" mode in its interface. Impulse blocks fire once when placed; Repeat blocks fire every game tick continuously.

Can normal players activate command blocks?

Yes -- any player can trigger a command block by pressing a button or stepping on a pressure plate connected to it. The command then runs with operator-level permissions regardless of who triggered it. Players cannot open or edit the command block interface without OP.

What is the difference between Conditional and Unconditional mode?

Unconditional (default): the command block always runs when activated. Conditional: the block only runs if the command block pointing into it succeeded on the same tick. Use Conditional in chains where later commands depend on earlier ones working.

Commands to try