Command blocks only exist in Creative mode and require cheats enabled

A command block is a special block in Minecraft that runs commands when activated. You cannot find it in the Creative inventory by default — you have to type a command to create it. Once you have one, you can place it anywhere in your world and feed it redstone power to execute commands automatically.

Command blocks work only in Creative mode or Survival mode with cheats turned on. They do not appear in Hardcore mode or on servers with cheats disabled. If you are playing on a multiplayer server, ask the server owner whether command blocks are allowed before trying to use them.

Key Takeaways

  • Enable cheats in your world settings before you can create a command block.
  • Use the command /give @s command_block to add a command block to your inventory.
  • Place the block, right-click it, and type the command you want it to run in the text field.
  • Connect redstone power (from a lever, button, or redstone dust) to make the block execute its command.
  • Command blocks run commands instantly and repeatedly as long as they receive power, which is different from typing commands yourself.

Enabling cheats in your world

Before you can create a command block, you must turn on cheats. If you are starting a new world, the option appears when you click "Create New World" and then "More World Options." Look for the "Allow Cheats" toggle and switch it on.

If you already have a world without cheats, you can still enable them. Pause the game, click "Open to LAN," toggle "Allow Cheats" on, and click "Start LAN World." This does not change your world permanently — cheats stay on only while you play that session. The next time you load the world, you will need to turn them on again unless you create a backup and edit the world file directly, which is more complicated.

Creating a command block with a give command

Once cheats are on, press the key to open the chat window (usually T on keyboard, or the right bumper on console). Type the command /give @s command_block and press Enter. The command block appears in your inventory immediately.

The @s part means "the player running this command" — so the block goes to you. If you are playing with others and want to give a command block to a different player, replace @s with their username, like /give PlayerName command_block.

Placing and configuring a command block

Take the command block from your inventory and place it in the world like any other block. Right-click it (or press the use button on console) to open the command interface. You will see a text field where you can type any command you want the block to run.

Type your command in the field. For example, /say Hello World makes the block broadcast a message to all players when activated. You can use any command that works in chat — summon mobs, change the weather, teleport players, or trigger custom functions. When you are done typing, click "Done" to save the command.

Powering a command block with redstone

A command block does nothing until it receives redstone power. You can power it by placing redstone dust next to it, connecting a lever or button to it, or running redstone wire from a repeater or comparator. When the block receives power, it runs its command once per game tick (20 times per second).

If you want the command to run only once instead of repeatedly, change the block's mode. Right-click the block again and look for the "Mode" dropdown. Set it to "Conditional" or "Needs Redstone" depending on what you want. "Needs Redstone" makes the block run only when powered; "Conditional" makes it run only if the previous command block in a chain succeeded.

Chaining command blocks together

You can connect multiple command blocks so they run in sequence. Place a second command block next to the first one, right-click it, and set its mode to "Conditional." Now the second block runs only if the first block's command succeeded. This is useful for complex setups where you need commands to happen in a specific order.

For example, you could have one block summon a mob, a second block give it armor, and a third block teleport it somewhere. If any command fails, the chain stops, which prevents broken setups from running commands you did not intend.

Common commands to try in a command block

/summon creeper ~ ~ ~1 spawns a creeper one block in front of the command block. /weather thunder starts a thunderstorm. /time set day sets the time to morning. /tp @p 0 100 0 teleports the nearest player to coordinates 0, 100, 0.

You can also use /execute to run commands from a specific location or as a specific player, or /fill to replace blocks in a large area. The Minecraft wiki has a full list of commands and their syntax if you want to build something more complex.

Frequently Asked Questions

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 commands that could break the world or ruin the game for others. Ask your server owner if you want to use them.

What happens if I type a command wrong in a command block?

The block will not run the command and will show an error message in the chat. Check the spelling and syntax, then right-click the block again to edit it. Command blocks are forgiving — a bad command just does nothing instead of breaking your world.

Do command blocks work in Bedrock Edition the same way as Java Edition?

The basic steps are the same, but some commands have different syntax. Bedrock Edition uses slightly different command formats, so if a command does not work, check the Bedrock Edition wiki for the correct version. The /give command to create the block works the same way in both versions.

Can I save a command block setup and use it in another world?

Yes, if you use a structure block to save the area as a structure file. Place a structure block, set it to "Save" mode, select the area containing your command blocks, and save it. Then in another world, place a structure block in "Load" mode and load the file. This copies the entire setup including all the commands.