Minecraft

How to Enable Command Blocks on a Minecraft Server

On new versions command blocks are a game rule; on older ones they are a line in server.properties. Here is which one you have and how to switch it on.

TheGameHosting Team 5 min read
Enable Command Blocks in Minecraft
Background: Minecraft © Mojang Studios

To enable command blocks on a Minecraft server running Java 1.21.11 or newer, type gamerule command_blocks_work true in the server 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. Then, as an operator in Creative, get one with /give @s minecraft:command_block. This guide covers every version and the errors you will see if something is missing.

Which setting does your version use?

Mojang moved this switch out of server.properties in 2025. According to the Minecraft Wiki, snapshot 25w35a (Java 1.21.9) replaced enable-command-block with a game rule, which was renamed in 25w37a and again in 25w44a (Java 1.21.11) when all game rules moved to snake_case names.

Server versionSettingHow to turn it onRestart?
Java 1.21.11 and newer (26.x)Game rule command_blocks_workgamerule command_blocks_work trueNo
Java 1.21.9 and 1.21.10Game rule commandBlocksEnabledgamerule commandBlocksEnabled trueNo
Java 1.21.8 and olderenable-command-block in server.propertiesenable-command-block=trueYes

The first lines of the console at startup tell you the exact version.

Enable command blocks on a Minecraft server (new versions)

  1. Open your server in the panel and click Console.
  2. Type gamerule command_blocks_work with no value to see the current setting.
  3. If it says false, type gamerule command_blocks_work true. No slash in the console.
  4. Join the game as an operator and switch to Creative with /gamemode creative.
  5. Type /give @s minecraft:command_block, place the block and right-click it to open it.
Server console
gamerule command_blocks_work
gamerule command_blocks_work true

The game rule is saved with the world and stays on after a restart. On Paper, Purpur and Spigot each world keeps its own game rules, so if you build in the Nether or End too, run it there as well: execute in minecraft:the_nether run gamerule command_blocks_work true.

Enable command blocks in server.properties (1.21.8 and older)

  1. Open Files in the panel and click server.properties.
  2. Find enable-command-block=false and change it to enable-command-block=true.
  3. Check that op-permission-level is 2 or higher (the default is 4).
  4. Save the file and restart the server.
  5. Get a command block with /give @s minecraft:command_block as an operator in Creative.
server.properties
enable-command-block=true
op-permission-level=4

If you update the server later, the old line no longer controls command blocks; check the game rule after the update. See how to update a Minecraft server for the update itself.

Who can use command blocks

Command blocks are locked down because they can run powerful commands. The Minecraft Wiki lists these requirements on a multiplayer server:

  1. Operator. Only operators can open and edit a command block. If you are not OP, see how to OP yourself on a Minecraft server.
  2. Creative mode. The edit window opens only in Creative, and only an operator in Creative can place or break one. Our guide on how to change gamemode on a Minecraft server shows how to switch.
  3. op-permission-level of 2 or more. Command blocks themselves run at permission level 2, so they can run commands like tp, give and gamerule, but not server-management commands such as op, ban or stop.

Command blocks do not appear in the Creative inventory by default. The Operator Utilities tab shows up only when the Operator Items Tab option is turned on in your controls settings, which is why most people use /give.

Stop command blocks from spamming chat

A repeating command block sends its output to operators' chat every time it runs. Turn that off with the command block output game rule:

Server console
gamerule command_block_output false

On 1.21.10 and older the rule is called commandBlockOutput. Players without OP never see this output, but admins will thank you.

Command blocks not working? Common fixes

  1. "Command blocks are not enabled on this server". The setting for your version is off. Use the table above: game rule on new versions, server.properties plus a restart on older ones.
  2. Right-click does nothing. You are not in Creative or not an operator. Check both.
  3. The rule name gives an error. You used the name for another version. command_blocks_work is 1.21.11 and newer; commandBlocksEnabled is 1.21.9 to 1.21.10.
  4. It works in the Overworld but not in the Nether. On Paper, set the rule in that world too.
  5. The block runs but the command fails. Read the output line in the block's window. Commands above level 2 cannot run from a command block.
  6. Edited server.properties on a new version. The old line does nothing there. Use the game rule.

Custom maps on a server that is always on

Adventure maps, minigames and parkour courses built with command blocks only shine when players can reach them. On TheGameHosting the server runs 24/7 on AMD 9950X or 7950X3D CPUs with NVMe storage, so repeating command blocks keep running smoothly and the world stays online when your PC is off. Switch the rule on in Console, edit server.properties in Files on older versions, and save your map in Backups before every big change. DDoS protection is included on every plan.

Java plans start at 2 GB for $1.90 USD per month, ready about 60 seconds after payment. See all sizes on Pricing or read about our Minecraft server hosting.

FAQ

How do I enable command blocks on my Minecraft server?

On Java 1.21.11 or newer, run gamerule command_blocks_work true in the console. On older versions use commandBlocksEnabled (1.21.9–1.21.10) or set enable-command-block=true in server.properties and restart.

Why does it say command blocks are not enabled on this server?

The command block setting for your version is off. Turn on the game rule, or on 1.21.8 and older edit server.properties and restart.

How do I get a command block in Minecraft?

As an operator, type /give @s minecraft:command_block. You must be in Creative to place it and open its window.

Can command blocks run /op or /stop?

No. Command blocks run at permission level 2, so server-management commands like op, ban and stop do not work from them.

Hosting for this game

Written by TheGameHosting Team, the people who run our servers in Dallas and Amsterdam and answer your tickets.

All posts