What a Command Block Is and How to Turn It On

A command block is a Minecraft block that runs commands when activated. It looks like a dark purple or dark red cube with glowing lines on it. Command blocks do not exist in Survival mode by default — you have to turn on cheats first, then create one using a command. Once you place one, you can type instructions into it that the game will carry out automatically, like spawning mobs, changing the weather, or teleporting players.

Command blocks are most useful in Creative mode or in custom maps where you want things to happen without a player typing commands manually. They let you build automated systems, create mini-games, or set up traps and puzzles.

Key Takeaways

  • You must turn on cheats in your world settings before you can create a command block.
  • Type /give @s command_block into the chat to receive a command block in your inventory.
  • Place the command block, then right-click it to open the interface where you type your command.
  • Command blocks have three modes — Impulse, Chain, and Repeat — that change when and how often they run.
  • Redstone power controls when a command block activates, so you can wire it to buttons, levers, or pressure plates.

Turning On Cheats in Your World

Before you can use command blocks, you need to enable cheats. If you are starting a new world, look for the "Allow Cheats" toggle when you create it and turn it on. If you already have a world open, pause the game, go to "Open to LAN", and toggle "Allow Cheats" to on. This only works in single-player worlds — multiplayer servers have their own cheat settings that the server owner controls.

Once cheats are on, you can open the chat window by pressing the T key (or the right D-pad button on console) and type commands directly. The command block itself is just a way to store and run those commands automatically without typing them each time.

Getting a Command Block Into Your Inventory

With cheats turned on, open the chat and type exactly this:

/give @s command_block

Press Enter. A command block will appear in your inventory. The @s part means "the player running this command" — so it gives the block to you. If you are playing on a server and want to give a command block to someone else, replace @s with their player name, like /give PlayerName command_block.

You can also find command blocks in the Creative mode inventory under the "Redstone" tab if you are building in Creative. Just search for "command" in the inventory search box and it will show up.

Placing and Opening the Command Block

Place the command block on the ground or on a wall like any other block. Right-click it (or press the use button on console) to open the command interface. You will see a text box labeled "Console Command" where you type what you want the block to do.

Below that are three buttons: "Impulse", "Chain", and "Repeat". These control when the command runs. Impulse runs once when the block receives a redstone signal. Chain runs once when the block in front of it finishes. Repeat runs over and over as long as the block has redstone power. For your first command block, Impulse is usually the right choice.

There is also a "Conditional" checkbox. Leave it unchecked for now — it makes the block only run if the previous block succeeded, which is useful for complex setups but not necessary to start.

Writing Your First Command

Start with something simple. Type this into the command box:

/say Hello World

Click "Done". Now you need to power the block with redstone. Place a lever next to the command block, flip the lever, and the command will run. You will see "Hello World" appear in the chat. That is the command block working.

Here are a few other commands to try once you understand the basics:

  • /summon zombie ~ ~ ~ — spawns a zombie at the command block's location
  • /weather rain — makes it rain
  • /time set noon — sets the time to noon
  • /give @s diamond 64 — gives you 64 diamonds

Powering a Command Block With Redstone

A command block only runs when it receives a redstone signal. The easiest way to send that signal is to place a lever or button next to it. Flip the lever or press the button, and the block activates. You can also use pressure plates, tripwire, redstone dust, or any other redstone component.

If you set the command block to Repeat mode, it will run constantly as long as redstone power is flowing to it. This is useful for things that need to happen over and over, like checking if a player is in a certain area. Impulse mode runs only once per redstone pulse, so it is better for one-time events like spawning a mob when someone presses a button.

You can chain multiple command blocks together by placing them in a line and setting them to Chain mode. The first block needs redstone power, and each block after it will run in sequence when the previous one finishes. This lets you run a series of commands in order without wiring redstone to each one.

Common Mistakes and How to Fix Them

If your command block is not working, check these things first. Make sure cheats are actually turned on — if you see a message saying "Unknown command", cheats are off. Make sure the command block has redstone power — if the lever is off or the redstone dust is not connected, nothing will happen. Make sure your command syntax is correct — commands are case-sensitive and spaces matter. If you type /Say hello instead of /say hello, it will not work.

If you see a red X on the command block, the command has an error. Right-click the block again and look at the text below the command box — it will tell you what is wrong. Common errors are misspelled player names, invalid coordinates, or missing arguments. Copy the command from a guide and paste it exactly to avoid typos.

Frequently Asked Questions

Can I use command blocks in Survival mode without cheats?

No. Command blocks require cheats to be turned on, which disables achievements in that world. If you want to keep achievements, you have to play in pure Survival mode without cheats or command blocks.

What is the difference between Impulse, Chain, and Repeat?

Impulse runs once when redstone power reaches it. Chain runs once when the command block before it finishes running. Repeat runs continuously as long as redstone power is flowing. Use Impulse for one-time events, Chain to run commands in sequence, and Repeat for ongoing effects.

Why does my command block show a red X?

The command has a syntax error. Right-click the block and read the error message below the text box. Common problems are misspelled names, wrong coordinates, or missing spaces. Copy commands from a reliable source and paste them exactly to avoid mistakes.

Can I use command blocks on a multiplayer server?

Only if the server owner has enabled command blocks in the server settings. Most public servers disable them to prevent players from running unauthorized commands. Private servers and realms can turn them on in the world settings.

How do I remove a command block?

Break it like any other block — just hit it with your tool or hand. The command block will drop as an item you can pick up and place elsewhere. If you are in Creative mode, it simply disappears.