Updated:
Enable Command Blocks game rule (command_blocks_work)
The "Enable Command Blocks" rule is called command_blocks_work in Java 1.21.11 and later, and commandBlocksEnabled in 1.21.10 and earlier. Controls whether command blocks run. Set it to false to stop every command block.
Basic data
| Name | Enable Command Blocks |
|---|---|
| Rule name (Java 1.21.11+) | command_blocks_work |
| Old name (Java 1.21.10 and earlier) | commandBlocksEnabled |
| Bedrock name | commandblocksenabled |
| Value type | true / false |
| Default | true |
Commands you can copy
Turn off (false)
/gamerule command_blocks_work falseReset to the default (true)
/gamerule command_blocks_work trueCheck the current value
/gamerule command_blocks_workJava 1.21.10 and earlier
/gamerule commandBlocksEnabled falseBedrock Edition
/gamerule commandblocksenabled falseNotes
- This rule moved from server.properties to a game rule in Java 1.21.9. Write
commandBlocksEnabledin 1.21.9–1.21.10 andcommand_blocks_workin 1.21.11 and later. - Java 1.21.11 renamed game rules to lower case with underscores. If an older command or a map description uses the old name, rewrite it for your version.
- Game rules are saved per world. On a server, a new world starts with the default values again.
Questions
Typing commandBlocksEnabled gives an error
In Java 1.21.11 and later the rule is called command_blocks_work. Write /gamerule command_blocks_work … instead. Worlds on 1.21.10 and earlier keep the old name.
How do I check the current value?
Run /gamerule command_blocks_work without a value. The current value is shown in chat.