Skip to content

Enshrouded 1.0 is out! 🎉 Get 25% OFF your next Enshrouded Server today!

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.

Updated 3 min read

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.

Minecraft versionWhat controls command blocksDefault
1.21.8 and olderenable-command-block in server.propertiesoff
1.21.9 and 1.21.10game rule commandBlocksEnabledon
1.21.11 and newer, including 26.xgame rule command_blocks_workon

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

  1. Open Config Editor in the Content group of the left rail and find Command blocks under Gameplay.
  2. Switch it on and press Save changes.
  3. 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 true

On 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_block

There 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 gamerule command 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 creative for your name, then check the Operators list.
  • give says the player cannot be found. The player has to be online. Join the server first.
Warning

Command blocks can run powerful commands, so give operator status only to people you trust.

Was this guide helpful?

Still stuck?

Talk to a real person, we answer fast.

  • Open a ticket

    Paste the exact error and name your server, so we can look at it from our side.

  • Ask on Discord

    Chat with the team and other server owners.

  • Browse the Help Centre

    Versions, mods, plugins, backups and RAM sizing, all in plain English.

Ready to launch your Minecraft server?

Aussie hardware, NVMe disks and DDoS protection, with the version and mod loader yours to change whenever you like.