How to Get Command Blocks in Minecraft and Enable Them

Published on

How to get command blocks in Minecraft with /give, the op level and Creative mode they need, and how to enable them on a Java or Bedrock server in 2026.

A Minecraft taiga with spruce trees, terraced grass hills and a lake

You can't craft a command block, you won't find one in a chest, and it is missing from the normal Creative tabs. So how do you get command blocks in Minecraft, and why does the one you placed on your server do nothing, or answer with "Command blocks are not enabled on this server"? Three things decide it: how you get the block, who may place and edit it, and whether command blocks are switched on in that world. The last one changed in 2025. On Java Edition it is no longer a line in server.properties but a game rule, and many guides still show the old line. Everything below is checked against Java Edition 26.3, the current release since 15 September 2026, and against Bedrock Edition.

Quick answer: To get command blocks in Minecraft, type /give @s minecraft:command_block in chat. That needs commands allowed in your single player world, cheats on in Bedrock, or operator status on a server, and you have to be in Creative mode to place and edit the block. On Java 1.21.11 and 26.x, command blocks are switched on by the game rule command_blocks_work, which is true by default, so run gamerule command_blocks_work true only if someone turned it off. The old enable-command-block=true line in server.properties only works on 1.21.8 and older. On Bedrock, turn on Cheats and the Command blocks toggle in the world settings.

How to Get Command Blocks in Minecraft Java Edition

A command block cannot be crafted, found or mined in Survival (Command Block). In Java you get one with a command or from a hidden Creative tab, and both need permission level 2 (give).

In a single player world on 26.3:

  1. Press Esc and open World Options. Turn on Allow Commands and set Personal Game Mode to Creative. Hardcore worlds can't allow commands.
  2. Open chat and run:
/give @s minecraft:command_block

The chain and repeating versions have their own item IDs:

/give @s minecraft:chain_command_block
/give @s minecraft:repeating_command_block

World Options replaced the difficulty button in the pause menu in 26.1, and the Allow Commands button for the host arrived there in 26.2 (World Options, Java Edition 26.2). On older versions, turn on Allow Commands when you create the world, or open the world to LAN with Allow Commands on. Before 1.20.5 both buttons were called Allow Cheats (Create New World, Multiplayer).

From the Creative inventory. Command blocks sit in the Operator Utilities tab, which stays hidden until you turn on Operator Items Tab under Options > Controls. The tab only shows when you have permission level 2, so allow commands first (Options, Permission level).

By copying one. Use Pick Block (the middle mouse button by default) on a command block to get another. Hold Ctrl while you do it and the copy keeps the command and settings inside (Controls).

Who Can Place and Edit Command Blocks

Only an operator in Creative mode can place, break or edit a command block, in both editions. In Java that means permission level 2 or higher: the command block screen does not open for anyone else, and on a server op-permission-level in server.properties must be 2 or more. Its default is 4 (Command Block, server.properties).

To become an operator on a Java server, someone with console access runs op YourName, which gives you the level set in op-permission-level (op). Then switch with /gamemode creative. Our ops.json guide shows how to give one player a different level, and the OP commands guide lists what each level can do.

Other players can still use what a command block does. Anyone can press a button on the block, and the command then runs at the block's own permission level, which is level 2 in Java. That is how a map hands out one item without giving everyone /give. A command block cannot run server management commands such as op, deop, ban, whitelist, save-all or stop (Command Block).

How to Enable Command Blocks on a Java Server

The switch depends on the server version:

Server versionHow to switch command blocks onDefault
1.21.8 and older, including modded 1.20.1 and 1.21.1 serversenable-command-block=true in server.properties, then restartoff
1.21.9 and 1.21.10gamerule commandBlocksEnabled trueon
1.21.11, 26.1, 26.2 and 26.3gamerule command_blocks_work trueon

Mojang removed the enable-command-block property in 1.21.9, released on 30 September 2025, and replaced it with a game rule, so the setting can change while the server runs (Mojang's 25w35a notes, Java Edition 1.21.9). The rule shipped as commandBlocksEnabled and became command_blocks_work in 1.21.11, when every game rule got a snake case ID (Java Edition 1.21.11). Our server.properties guide lists the other settings that moved with it.

Type it in the server console without the slash:

gamerule command_blocks_work true

In game, an operator types the same line with a slash. Leave the value off, as in gamerule command_blocks_work, to see the current setting. The value is saved in the world itself (in data/minecraft/game_rules.dat since 26.1), so it survives restarts (Java Edition level format). In single player, the same switch is called Enable Command Blocks in the Edit Game Rules screen, which you open from World Options.

Check the rule after updating from 1.21.8 or older. We searched Mojang's game files for 1.21.9, 1.21.10 and 26.3, and none of them reads enable-command-block any more. An old enable-command-block=false line is ignored, and the world gets the rule's default, true. So on a vanilla server, command blocks that were off before the update are on after it. To switch them off again:

gamerule command_blocks_work false

Paper keeps game rules per world, and it stores the Nether and the End as separate dimensions with their own data (PaperMC 26.1 notes). Set the rule in all three:

gamerule command_blocks_work false
execute in minecraft:the_nether run gamerule command_blocks_work false
execute in minecraft:the_end run gamerule command_blocks_work false

On Space-Node's Minecraft hosting, every plan runs on the Pterodactyl panel, so you type these lines in its live console without joining the game. On 1.21.8 and older, you change server.properties in the panel's file manager and restart.

"Command Blocks Are Not Enabled on This Server"

That message, and the two that replaced it, come from clicking Done in the command block screen while command blocks are off. The wording tells you the version:

Message in chatVersionFix
Command blocks are not enabled on this server1.21.8 and olderenable-command-block=true, then restart
Command blocks are not enabled1.21.9 and 1.21.10gamerule commandBlocksEnabled true
Command set: (your command), but command blocks are still disabled1.21.11 and newergamerule command_blocks_work true

We took the texts from the English language file in each version's game files. Up to 1.21.10 the edit is not saved. Since 1.21.11 it is, and the block just does not run until the rule is true again. The bug report behind that change points out that it lets you defuse a runaway repeating command block after switching command blocks off (MC-302030).

Two other problems look similar:

  • Right-clicking the block does nothing. You are not an operator with level 2 or higher, or you are not in Creative mode. If chat says "Must be an opped player in creative mode", the server refused your edit for the same reason.
  • The command is saved, but nothing happens. Impulse and repeating blocks need a redstone signal by default. Place a button or lever on the block while sneaking, or set it to Always Active, and read the Previous Output box for an error.

Command Blocks in Bedrock Edition

In Bedrock you get a command block with a command (Microsoft Learn):

  1. In the world settings, go to Cheats and turn on Cheats (Activate Cheats in older menus). This disables achievements for that world.
  2. Check that the Command blocks toggle under it is on (Command Blocks Enabled in older menus). It is on by default (Edit world).
  3. Run /give @s command_block in chat.

That toggle is the game rule commandblocksenabled, so /gamerule commandblocksenabled true does the same (Microsoft Learn gamerule). As on Java, you place and edit command blocks as an operator in Creative mode (Permission level). With the rule off, Bedrock still lets you edit a command block, which then just doesn't run (MC-302030).

On a Bedrock Dedicated Server, set allow-cheats=true in server.properties (the default is false) and restart, or type changesetting allow-cheats true in the console, which applies at once but is not written to the file (server.properties, changesetting). Then join once and run op YourName in the console, because Bedrock only ops players who are online (op).

The Three Command Block Types

TypeColorRunsStarts as
Impulseorangeonce each time it is activatedNeeds Redstone
Chaincyanwhen the block pointing into it runsAlways Active
Repeatpurpleevery game tick while activeNeeds Redstone

The command block screen switches the type, Conditional or Unconditional, and Needs Redstone or Always Active. A conditional block only runs when the block behind it succeeded. Commands need no slash inside a command block and can be up to 32,500 characters long, and Bedrock adds a Delay in Ticks field (Command Block). For a first test, place an impulse block, enter say Command blocks work and click Done (on Bedrock, close the screen). Then sneak while you place a button on the block, because a normal click opens its screen again, and press the button (Sneaking). For something more useful, our guide to the /kill command has the selectors for clearing dropped items and mobs without touching players.

Keep the Chat Readable on a Server

Every time a command block runs, operators get a chat line about it, and a repeating block on a clock fills the chat fast. Turn that off with:

gamerule command_block_output false

On Bedrock the rule is commandblockoutput (Game rule). The block still writes its last output to the Previous Output box. In Java, the O button next to that box switches to X and stops a block from storing its output at all, which can cut memory and storage use in worlds with many command blocks on fast clocks (Command Block).

FAQ

Can you get command blocks in Survival? Not without commands. You need commands allowed in the world (Java single player), cheats on (Bedrock) or operator status (servers), and you have to switch to Creative to place one. A Survival player can't break a command block either.

Why are command blocks not in my Creative inventory? On Java they sit in the Operator Utilities tab, which only shows when Operator Items Tab is on under Options > Controls and you have permission level 2. Bedrock has no such tab, so use /give @s command_block.

How do I enable command blocks on my server? On Java 1.21.11 and 26.x, run gamerule command_blocks_work true in the console. On 1.21.9 and 1.21.10 the rule is commandBlocksEnabled. On 1.21.8 and older, set enable-command-block=true in server.properties and restart. On a Bedrock Dedicated Server, set allow-cheats=true.

What does "Command blocks are not enabled on this server" mean? It is the message from 1.21.8 and older when enable-command-block is false. Change the line to true and restart. If your server runs 1.21.9 or newer, that line does nothing, so use the game rule instead.

Do command blocks work on Realms? Yes. Outside minigames, the owner of a Java Realm is always an operator, and since 1.21.5 a world you upload has command blocks on by default. To make another player an operator, the owner quits to the main menu and opens the Realm's configuration screen (Realms).

Sources

All opened on 1 November 2026: