How to Enable Command Blocks on a Minecraft Server

Enable command blocks on your Minecraft Java server using the correct property or game rule for your version. Includes a simple test and rollback.

Check your Minecraft Java version in Console. The command block setting differs by release.

Visual guide: give access in the right place. See the steps for the exact settings used by this game.

Minecraft 1.21.11 and newer

Enter gamerule minecraft:command_blocks_work true in Console. Omit true to read the value, or use false to disable it. No restart is needed.

Minecraft 1.21.9 and 1.21.10

Enter gamerule commandBlocksEnabled true. Omit true to check it, or use false to disable it. No restart is needed.

Minecraft 1.21.8 and older

  1. Open server.properties and set enable-command-block=true. Add the property if it is missing.
  2. Save and restart the server. Set it to false and restart to disable it again.

The 1.21.9 release notes explain the move to a game rule. 1.21.11 renamed it. The old property does not enable command blocks on newer versions.

Test a command block

  1. Use a trusted operator account in Creative mode. If needed, enter op PlayerName and gamemode creative PlayerName in Console for your own Java username.
  2. Enter give PlayerName minecraft:command_block. Place it and use an impulse block that needs redstone.
  3. Set its command to say Command block test, then attach and press a button.
  4. Remove the block and restore your original game mode. If operator access was temporary, enter deop PlayerName.

If it does not run

Check the rule for your version, loaded area and redstone signal. Use a non-conditional block for this single test. Repeating blocks can run every tick, so test unfamiliar commands in an impulse block first.

Troubleshooting checks

If the result is not what you expected
What you seeWhat to check
The setting is not recognizedUse the property or game rule for your installed Java release. These names changed between versions.
The rule is enabled but the block does nothingTest the impulse block and its redstone trigger with the simple example before debugging a larger command setup.

Related: Edit server properties · Change version.

Was this article helpful?

Your feedback helps us improve our guides.

Written by Konnect HostingUpdated 2 min read