The command to get a command block depends on which version you're playing

In Java Edition (the PC version most players use), you type /give @s command_block into the chat. In Bedrock Edition (Windows 10/11, consoles, mobile), the command is /give @s command_block as well, but you need to have cheats turned on first. The @s means "give it to myself" — if you want to give one to another player, replace @s with their username.

Before you can use any command at all, you need to enable cheats on your world. This is a one-time setting when you create a new world, or you can turn it on in an existing world through the world settings menu. Without cheats enabled, the game will treat your command as regular text and nothing will happen.

Key Takeaways

  • The command /give @s command_block works in both Java and Bedrock editions once cheats are turned on.
  • You must enable cheats when creating a world or through the world settings menu before any command will work.
  • Command blocks only appear in Creative mode or in Survival mode if cheats are on — they do not exist in pure Survival without cheats.
  • Once you have a command block, you place it like any other block and right-click it to open the editor where you type the commands you want it to run.

How to turn on cheats in Java Edition

When you create a new world, the world creation screen shows a "Allow Cheats" toggle near the bottom. Click it to turn cheats on before you click "Create New World." If you already have a world and want to turn cheats on, pause the game, click "Open to LAN," check the "Allow Cheats" box, and click "Start LAN World." This only works while you are in that world — it does not permanently change the world file, but it lets you use commands for that session.

The second method is permanent: exit the world, go to your world folder (on Windows this is usually in AppData\Roaming\.minecraft\saves), find the world folder, open the file called level.dat with an NBT editor (a free tool like NBTExplorer), and change the "allowCommands" value from 0 to 1. This is more technical but survives closing and reopening the game.

How to turn on cheats in Bedrock Edition

On Windows 10/11, create a new world and before you click "Create," scroll down to the "Cheats" section and toggle "set up Cheats" on. On Nintendo Switch, PlayStation, or Xbox, the toggle is in the same place during world creation. On mobile (iOS or Android), the setting is called "Cheats" and appears in the world settings before you create the world.

If you have an existing Bedrock world without cheats, you cannot turn them on after the fact the way you can in Java. You would need to create a new world with cheats enabled, or use Creative mode instead (which does not require cheats and gives you access to all blocks including command blocks).

Where to find the command block once you have it

After you type the command, a command block appears in your inventory. It looks like a dark purple cube with a small square symbol on it. Pick it up and place it in the world like you would place dirt or stone. The command block will not do anything until you right-click it (or press the use button on console) to open the command editor window.

In the editor, you see a text box where you can type any command you want the block to run. You can also set the block to "Impulse" (runs once when powered), "Chain" (runs when the previous block finishes), or "Repeat" (runs every game tick while powered). Most new players leave it on Impulse and power it with a redstone button or lever placed next to it.

Why you might not see the command block in Creative mode

In Creative mode, command blocks are available in the creative inventory without needing cheats or the /give command. However, some servers or custom worlds disable them even in Creative. If you cannot find the command block in the creative inventory, check whether the server or world creator has restricted access to it — this is common on multiplayer servers to prevent players from running unwanted commands.

On single-player Creative worlds you own, command blocks should always be available. Search for "command" in the creative inventory search box to find it faster than scrolling through all the blocks.

What happens if the command does not work

If you type /give @s command_block and nothing happens, the most common reason is that cheats are not actually on. Pause the game and check the world settings — if "Allow Cheats" or "set up Cheats" shows as off, go back and turn it on. On Java Edition, if you used the "Open to LAN" method, remember that it only lasts for that session.

The second reason is a typo in the command itself. The command is case-sensitive on Java Edition, so /Give or /GIVE will not work — it must be lowercase /give. Bedrock Edition is more forgiving with capitalization. Make sure there is a space between /give and @s, and another space between @s and command_block, with no extra spaces or punctuation.

Frequently Asked Questions

Can I use command blocks on a multiplayer server?

Only if the server owner has given you operator (op) status. Regular players cannot use commands or command blocks on most servers. Ask the server owner or admin to op you if you want to build with command blocks.

Do command blocks work in Hardcore mode?

Yes, if you turn cheats on when you create the Hardcore world. Cheats work the same way in Hardcore as in regular Survival, but remember that Hardcore has permadeath — if you die, the world is gone forever.

What is the difference between a command block and a repeating command block?

A command block set to "Impulse" runs once each time it receives a redstone signal. A "Repeat" command block runs every game tick (20 times per second) as long as it is powered. "Chain" blocks run only after the block before them finishes, and are useful for running multiple commands in order.

Can I copy and paste commands into a command block?

Yes. Right-click the command block to open the editor, then paste your command into the text box. This is much faster than typing long commands by hand, especially if you are copying from a guide or tutorial.