Updated:
Command blocks are easier to learn when you start from small commands that give visible results. This page lists useful commands for beginners and links each one to a generator or detailed guide.
First commands to try
/give @p minecraft:command_block- get a command block./tp @p ~ ~5 ~- teleport the nearest player upward./summon minecraft:zombie ~ ~ ~- spawn a test mob./effect give @p minecraft:speed 30 1- add speed for 30 seconds./fill ~-2 ~ ~-2 ~2 ~ ~2 minecraft:glass- place a small floor.
Repeating vs impulse vs chain
| Type | Color | Runs | Use it for |
|---|---|---|---|
| Impulse | Orange | Once each time it gets a redstone signal | Buttons, warps, giving a kit |
| Repeating | Purple | Every game tick (20 times a second) while powered | Constant checks, such as "is anyone standing here?" |
| Chain | Green | Right after the block pointing into it runs | Running several commands in order |
Keep your first tests small to avoid lag or unexpected world changes.
Beginner mistakes
- Forgetting to enable command blocks on a server.
- Using a command that requires operator permission.
- Running a destructive /fill command without testing coordinates.
- Using Java syntax in Bedrock or Bedrock syntax in Java.
Example: move a summon to a player’s position
/execute at @p run summon minecraft:pig ~ ~1 ~When a command runs directly in a command block, ~ ~ ~ refers to that block. The Java example above changes the execution position to the nearest player first, then summons a pig one block higher. It is an easy way to observe the difference between the executor and the execution position.
Test an impulse block before repeating
Place an impulse command block with a button, run one command and verify the result. A repeating block can create many entities rapidly, lag the world or repeatedly grant effects. Switch to repeating mode only after you have confirmed the command and added the necessary conditions or cooldown.
Debugging a chain
Conditional chain blocks depend on the success of the previous block. If a later command does not run, inspect the previous step and its target selector. Also check arrow direction, redstone mode and whether the server permits command blocks.
The settings in the command block window
- Needs Redstone / Always Active: Always Active runs without a signal. Chain blocks are usually set to Always Active so they follow the block before them.
- Unconditional / Conditional: a conditional block only runs if the block behind it succeeded. The arrow on the block's side shows which way the chain flows.
- Track output (the "O" button): shows the last result in the window. This is the quickest way to see why a block did nothing.
Stop the chat spam
| Version | Command |
|---|---|
| Java 1.21.11 and later | /gamerule minecraft:command_block_output false |
| Java 1.21.10 and earlier, Bedrock | /gamerule commandBlockOutput false |
By default every command block run is announced to operators in chat. A repeating block can fill the chat in seconds, so most map makers turn this off first.
Getting command blocks to work at all
- Single player (Java): the world needs cheats on, and you must be in Creative to open the block.
- Server (Java): set
enable-command-block=truein server.properties and restart (1.21.8 and older). From Java 1.21.9 this property is gone and command blocks work by default; if they were turned off, run/gamerule command_blocks_work true(commandBlocksEnabledon 1.21.9 and 1.21.10). Only operators can edit them. - Bedrock: turn on Activate Cheats and Command Blocks Enabled in the world settings. Get one with
/give @s command_block.