What a command block is and why you'd use one

A command block is a Minecraft block that runs text commands automatically when activated. Unlike typing commands into the chat window yourself, a command block executes the same instruction every time you trigger it — by walking into it, stepping on a pressure plate connected to it, or sending a redstone signal to it. This makes command blocks useful for building automated systems, creating custom game rules, spawning items or mobs on demand, or setting up puzzle mechanisms in your world.

Command blocks only work in Creative mode or in Survival mode if you have cheats turned on. They're a way to automate repetitive tasks and build interactive structures without installing mods or resource packs. A single command block can teleport you somewhere, change the time of day, summon a creature, or trigger a chain of events across your world.

Key Takeaways

  • Command blocks must be obtained in Creative mode or by enabling cheats in your world settings, then placed like any other block.
  • You open a command block's interface by right-clicking it, then type your command in the text field and click Done.
  • Redstone signals set up command blocks — you can use buttons, levers, pressure plates, or redstone dust to trigger them.
  • Command blocks run the same instruction every time they're triggered, making them useful for automation and interactive builds.
  • Common beginner commands include /summon to spawn creatures, /give to create items, and /teleport to move players to specific locations.

Getting a command block into your world

In Creative mode, command blocks appear in the creative inventory under the Redstone tab. Search for "command" in the inventory search bar, then click and drag the command block into your hotbar. Place it anywhere in your world the same way you place any other block.

In Survival mode, you must enable cheats first. Open your world settings, toggle "Allow Cheats" to on, and save. Then open the chat window and type /give @s command_block and press Enter. A command block will appear in your inventory. Place it in your world and you're ready to use it.

If you're playing on a server or in a multiplayer world, only players with operator (op) status can use command blocks. The server owner or an admin must grant you op permissions before you can place or edit them.

Opening and entering your first command

Right-click the command block you've placed. A window will open with a large text field labeled "Command." This is where you type the instruction you want the block to run. The window also shows a dropdown menu set to "Impulse" by default — this is the block type, which you can usually leave as is when starting out.

Type a straightforward command to test it. For example, type /give @s diamond 1 and click Done. This command gives you one diamond when the block activates. The command block will turn green if the syntax is correct, or red if there's an error in your text.

Close the window and your command is saved. Now you need to set up the block by sending it a redstone signal.

Activating your command block with redstone

Command blocks don't run on their own — they need a redstone signal to set up. The simplest way is to place a button next to the command block and click it. The button sends a pulse of redstone energy that triggers the block once.

Other ways to set up a command block include placing a pressure plate on top of it (activates when you walk on it), connecting redstone dust from a lever (activates when you toggle the lever on), or using a repeater to send continuous signals. You can also chain multiple command blocks together so that one triggers the next in sequence.

Test your setup by triggering the redstone signal. If your command block turns green and the signal reaches it, the command will run. Check your inventory to see if the diamond appeared. If nothing happened, double-check that the command syntax is correct and that the redstone signal is actually reaching the block.

Common commands to start with

/summon creeper ~ ~ ~ spawns a creeper at your current location. Replace "creeper" with any mob name — zombie, skeleton, pig, or dragon — to spawn different creatures. The three tildes (~) mean "at my current coordinates."

/give @s stone 64 gives you 64 stone blocks. Change "stone" to any item name and change "64" to any number up to 64 to give yourself different items in different amounts.

/teleport @s 100 64 200 moves you to the coordinates X=100, Y=64, Z=200. Replace those numbers with any coordinates in your world to create a teleporter.

/time set day sets the time to daytime. Use /time set night for nighttime or /time set noon for midday.

/weather clear stops rain and storms. Use /weather rain or /weather thunder to change the weather.

Understanding command block types

When you open a command block, the dropdown menu shows three types: Impulse, Chain, and Repeat. Impulse blocks run once each time they receive a redstone signal. This is what most beginners use.

Chain blocks run only when the block directly behind them (in the direction they're facing) runs successfully. They're useful for creating sequences where one command must complete before the next starts. Repeat blocks run every game tick (20 times per second) as long as they're receiving a redstone signal. Use these carefully because they can slow down your world if overused.

You can also toggle "Conditional" on or off. When Conditional is on, the block only runs if the previous block in the chain succeeded. Leave it off when starting out.

Troubleshooting when commands don't work

If your command block turns red instead of green, there's a syntax error in your command. Check that you've spelled the command name correctly, used the right number of spaces, and included all required parts. Copy the command from the official Minecraft wiki if you're unsure.

If the block is green but nothing happens, the redstone signal may not be reaching it. Check that your button, lever, or pressure plate is actually connected to the block and that you're triggering it. Walk right next to the block and look at it — if it's powered, you'll see redstone particles around it.

If you're in Survival mode and the block won't place or edit, cheats may not be enabled. Go back to your world settings and confirm "Allow Cheats" is toggled on. If you're on a server, ask an admin to grant you op status.

Frequently Asked Questions

Can I use command blocks in Survival mode without enabling cheats?

No. Command blocks only work if cheats are enabled in your world settings. Enabling cheats doesn't disable achievements in newer versions of Minecraft, so you can still earn them while using command blocks.

What's the difference between a command block and typing a command in chat?

A command block runs the same instruction automatically every time it's triggered by redstone, while chat commands run once when you type them. Command blocks are useful for building repeatable systems and interactive structures that don't require you to type anything.

Can I make a command block run multiple commands at once?

One command block runs one command. To run multiple commands in sequence, place several command blocks in a line and set them to Chain type, with each one facing the next. The first block needs a redstone signal, and the rest will run in order if each one succeeds.

Do command blocks work on multiplayer servers?

Yes, but only players with operator status can place or edit them. The server owner or an admin must grant you op permissions first. Once you have op, you can use command blocks the same way you would in single-player.

Where do I find a list of all available commands?

The official Minecraft wiki has a complete command reference organized by what each command does. You can also type /help in chat to see a list of commands available in your world, though the wiki is more detailed and easier to search.