Enable and get command blocks
Command blocks moved from a server.properties switch to a game rule in 1.21.9. Turn them on for your version, then give yourself one from the Console.
Command blocks run Minecraft commands from inside the world, which is how adventure maps and redstone contraptions are built. They are off by default on older versions and on by default on newer ones, and the setting that controls them moved in 1.21.9. This guide shows the right switch for your version, then how to get a command block into your hands.
Checked against Minecraft Java Edition 26.3, October 2026.
Find your version
Open the JAR Manager tab, under More in the left rail, and read the Minecraft version it shows. Then use the row that matches.
Mojang removed the enable-command-block property in 1.21.9 and replaced it with a game rule. In 1.21.11 every game rule was renamed to lowercase words joined by underscores.
On 1.21.8 and older
- Open Config Editor in the Content group of the left rail and find Command blocks under Gameplay.
- Switch it on and press Save changes.
- Restart from the Console tab. The panel reminds you after saving that the change needs a restart.
On 1.21.9 and newer
The Command blocks switch in Config Editor no longer controls anything, because Mojang removed that property. Use the game rule in the Console tab instead, with no leading slash:
gamerule command_blocks_work trueOn 1.21.9 and 1.21.10 the name is commandBlocksEnabled. To see the current value without changing it, leave off true. The rule starts on, so you only need this if someone turned it off. Game rules are case-sensitive.
Get a command block
You need to be an operator and in Creative mode to place and edit one. Make yourself an operator from the Players tab: open Operators and press Make operator. Whitelist players and set operators has the steps.
Then, with your player online, run these in the Console tab, using your own name:
gamemode creative Alex
give Alex command_blockThere are three types: command_block, chain_command_block and repeating_command_block. The Minecraft Wiki's Command Block page describes how each one behaves. Swap the name in the give command for the one you want. The Give Items tab under Players builds give commands for you too.
Place the block, then use the Use Item control on it to open its command box.
If it does not work
- The block opens but nothing runs. The game rule is off. Run the
gamerulecommand above, using the name for your version. - The box will not open. Check you are an operator and in Creative mode, as above. Run
gamemode creativefor your name, then check the Operators list. givesays the player cannot be found. The player has to be online. Join the server first.
Command blocks can run powerful commands, so give operator status only to people you trust.
Was this guide helpful?
Related guides
Turn off PvP on your Minecraft server
Stop players damaging each other. Use the pvp game rule on 1.21.9 and newer, or the Config Editor PvP switch on older servers.
Set a Minecraft server resource pack
Pick a pack from Modrinth or paste your own https link in the Config Editor, let the panel save its checksum, and make players load it on join.
Make a hardcore Minecraft server
Create a fresh world with Hardcore on in the Config Editor, see what changes on death, and bring a dead player back with a console command.
