Check your Minecraft Java version in Console. The command block setting differs by release.
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
- Open server.properties and set enable-command-block=true. Add the property if it is missing.
- 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
- Use a trusted operator account in Creative mode. If needed, enter op PlayerName and gamemode creative PlayerName in Console for your own Java username.
- Enter give PlayerName minecraft:command_block. Place it and use an impulse block that needs redstone.
- Set its command to say Command block test, then attach and press a button.
- 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.
Related: Edit server properties · Change version · Minecraft hosting.
Your feedback helps us improve our guides.


