
How to Make a Command Block in Minecraft
Hello, fellow Minecrafters! If you're here, you're looking to unlock one of the game's most powerful tools: the command block. You've probably seen amazing custom maps or YouTube videos showcasing incredible feats, all powered by these special blocks. But getting your first one can be a bit confusing, especially when the solution isn't in your crafting book. It can be frustrating when you're told to just "type a command," but you're not sure where or how.
You're in the right place. This guide will explain everything, step-by-step, in the simplest way possible.
First, let's clear up a common misconception. If you've been searching for a "command block recipe" or wondering "how to craft a command block in Minecraft", you can stop looking. The command block is a special item that cannot be crafted in a crafting table like a sword or a furnace. It can only be obtained using a game command.
Let's dive into how to get a command block.
Step 1: The Golden Rules - Prerequisites
Before you can get your hands on this magical block, you need to make sure your world is set up correctly. There are two non-negotiable rules.
If you're confident that you've Enabled Cheats and are in Creative Mode, you can skip these two sections and go directly to Step 2.
1. Cheats Must Be Enabled
Command blocks are powerful. They can change the weather, teleport players, give items, and so much more. Because of this, they are considered a "cheat" feature. You must have cheats enabled in your world to spawn and use them. (You can find detailed steps on how to enable cheats in our guide: How to Write Commands in Minecraft)
- For a New World: When creating a new world, you will see an option for "Allow Cheats." Make sure this is set to ON.
- For an Existing Single-Player World (Java Edition): Pause the game, click "Open to LAN," set "Allow Cheats" to ON, and then click "Start LAN World." This will enable cheats for your current play session.
- For an Existing World (Bedrock Edition): Pause the game, go into Settings, and under the "Game" tab, scroll down to find the "Cheats" section. Make sure "Activate Cheats" is toggled on.
2. You Must Be in Creative Mode
Command blocks are intended for world creators and map makers, so they are only usable in Creative Mode. While you can obtain one in Survival mode (if cheats are on), you won't be able to place it down or edit it. So, to make things easy, make sure you're in Creative Mode.
You can switch to Creative Mode by opening the chat window, typing /gamemode creative
, and hitting
A Quick Word on the "Chat" Window
You might be wondering why you need to open the "chat" window to enter a command. In Minecraft, the chat and command functions share the same interface. This window is your command console. If you're playing in a single-player world, there's no one else to chat with, so you can think of it purely as a tool for interacting with the game's code. It's a necessary step for using commands.
Minecraft treats your chat messages as a command when they start with /
. For example, if you send a chat message like Hi, Peter
, it will be treated as a normal chat message because it doesn't start with /
. If you type /Hi, Peter
, the game will treat it as a command and give you an error message because there is no command like /Hi, Peter
. You can learn about available commands and how to use them in our guide: How to Write Commands in Minecraft.

You may also notice that there are two different keys in Minecraft's settings: one for "Open Chat" and another for "Open Command". It's important to know that these two buttons open the exact same interface (the chat window). The only difference is that the game will automatically add the /
prefix when you press the "Open Command" key, which is convenient for typing commands directly without needing to input a /
yourself.
Step 2: The Magic Words - The Command
Now that your world is set up, and you will ask "what is the command to get a command block?" Let's move on.
First, you need to open the chat/command window.
- On Java Edition: Press the Tkey or the/key.
- On consoles like Xbox, Switch, and PlayStation: Press the right button on the D-Pad. Below is an image of the controls for these consoles from the Minecraft Wiki.
- On mobile devices: Tap the chat icon at the top of the screen.

Once the window is open, type the following command exactly as it appears here:
/give @p command_block
Press Enter, and a command block will appear in your inventory!
Breaking Down the Command
It might look like code, but it's actually a simple sentence for the game.
/
: This slash at the beginning tells Minecraft, "Hey, listen up! I'm about to give you a command." It indicates to the game that this message is a command, not a chat message.give
: This is the action. You're telling the game to give an item.@p
: This is the target.@p
is a special shortcut that means "the nearest player". Since you're the one typing the command, that's you! You can also replace@p
with your own username. For example, if your name is Peter,/give Peter command_block
will do the same thing.command_block
: This is the item you want. It's the item's in-game ID. If you later want to give another item and don't know its ID, you can search online for it.
For more information about /give
, you can check the Minecraft Wiki.
So, you're literally just telling the game: "Give the nearest player a command block." That's all there is to it. This is how to get the command block in minecraft using commands.
Step 3: Platform Differences (Bedrock vs. Java)
The great news is that the process is nearly identical whether you're playing on PC, a console, or a mobile device.
How to Get a Command Block in Minecraft Bedrock
For players on Xbox, PlayStation, Nintendo Switch, Windows 10/11 Edition, or mobile, you are on the Bedrock Edition. The command is exactly the same: /give @p command_block
. The only difference is the button you press to open the chat window. The world of command blocks in Minecraft Bedrock is now open to you!
How to Get a Command Block in Minecraft Java Edition
For players on PC, Mac, or Linux, you are likely on Java Edition. The process is the same as described above. Press
/give @p command_block
, and press Step 4: You Have a Command Block... Now What?
Okay, you've figured out how to spawn a command block in Minecraft. But how do you use it? Let's cover the absolute basics.
Place the command block on the ground like any other block. To open its interface, right-click on it (or use the equivalent "use" button on your controller/device, just like opening a chest).
You'll see a console screen where you can enter commands. For a very simple first command, try typing this into the "Command Input" field:
say Hello World

Now, place a button or a lever on the side of the command block and activate it. The message "Hello World" will appear in the chat for everyone to see! You have successfully learned how to use a command block in Minecraft!

Note: You don't need to put a /
before commands in a command block. In the chat window, the /
tells the game you're entering a command. In a command block's interface, the game already knows it's a command, so the /
is unnecessary.
The Three Types of MC Command Blocks
You'll notice you can change the "Block Type" inside the interface.
- Impulse (Orange): This is the default. It runs its command once every time it is activated by a Redstone signal (like a button or a lever).
- Chain (Green): This is a special type. A minecraft chain command block will only run its command if the command block pointing into it has successfully run its command. This allows you to "chain" commands together in a sequence. Learning how to use a chain command block is key for complex creations.
- Repeat (Purple): This block will run its command over and over, up to 20 times a second, as long as it has a Redstone signal. Be careful with this one, as it can cause a lot of lag if used improperly!

Conclusion
Congratulations! You don't need to Google "how do you make a command block" anymore. You've mastered the essential first step into the much larger world of minecraft with command block creations.
To recap, the key steps are:
- Ensure Cheats are ON and you are in Creative Mode.
- Open the chat/command window.
- Type the command:
/give @p command_block
and press Enter.
From here, you can explore the thousands of commands available for command blocks (which are mostly the same in Bedrock and Java) and start automating your world. Have fun creating