Command Blocks: the basics
Command block types, their modes, delays and how to build simple setups.
Introduction
Command blocks are special blocks in Minecraft that run commands automatically, with no input from the player. They're the foundation of adventure maps, minigames, server systems and automation in Creative mode. There are three types of command blocks: Impulse (orange), which runs its command once when it receives a redstone signal; Chain (green), which runs its command right after the previous command block in the chain has finished; and Repeat (purple), which runs its command every game tick (20 times per second) for as long as it receives a signal. Every command block can work in Conditional or Unconditional mode. Conditional mode checks whether the previous command block in the chain ran successfully, which lets you build if-else conditions without /execute if. Command blocks also have a Needs Redstone / Always Active toggle: in Always Active mode, Chain and Repeat blocks work without an external redstone signal. To get a command block, use the /give @s command_block command. To edit the command in a block, right-click it. You build command block chains by placing the blocks one after another: the arrow on each block shows the direction in which the chain continues. A typical setup is Repeat → Chain → Chain → Chain, where the Repeat block starts the sequence and the Chain blocks after it run the next commands.
Topics covered in this guide
Here are the topics this guide covers. Each one comes with a detailed explanation, example commands and practical uses.
- The three types of command blocks: Impulse, Chain, Repeat
- Conditional and Unconditional modes
- Needs Redstone vs Always Active
- How to get a command block: /give
- Editing the command in a block: the interface
- Building chains: the direction of the arrow
- Redstone signals and command blocks: buttons, clocks
- A practical example: a welcome system for new players
- Organizing command blocks in your world: labels and keeping things tidy
Tips and tricks
Practical tips we picked up while working with this part of Minecraft. Remember them: they'll save you hours of trial and error.
- Get a command block with a command: /give @s minecraft:command_block.
- A chain of Chain command blocks has to be continuous: each block's arrow must point into the next one.
- Repeat + Always Active is the equivalent of a ticking function in a data pack: it runs 20 times per second.
- Conditional mode checks whether the PREVIOUS block in the chain succeeded, not the block that powered it with redstone.
- Use /gamerule commandBlockOutput false to stop command blocks from spamming the chat.
Difficulty level
This guide is rated Easy (2/5). You don't need any previous knowledge of commands, so it's a perfect place to start.
Tags
Related guides
- Minecraft command basics - Beginner - An introduction to the command system: the chat window, syntax, arguments and first steps.
- The /execute command: advanced use - Expert - The most important command in Minecraft: conditions, positions, context changes and execute chains.
- Command Blocks: advanced systems - Expert - Complex command block setups: loops, state systems, minigames and optimization.
- Target selectors: @a, @p, @r, @s, @e - Easy - How to pick the targets of your commands precisely with selectors and their filter arguments.
Useful tools
- /give command generator - build /give commands with custom NBT interactively
- /summon command generator - create mob summoning commands visually
- /execute command generator - a step-by-step builder for /execute chains
- /effect command generator - add status effects with a command
- Command encyclopedia - the full list of all Minecraft commands