How do I enable command blocks on my Minecraft server?
How to enable command blocks on your Minecraft server: with a game rule since 1.21.9 and in server.properties on older versions.
By Yvan Watchman Updated
How you enable command blocks depends on your Minecraft version. Since 1.21.9 it is no longer a setting in server.properties but a game rule, and it is on by default. On older versions you enable it in server.properties.
Good to know
Using command blocks requires OP rights and Creative mode. See How do I give a player OP on my Minecraft server?
Minecraft 1.21.9 and newer (including 26.x)
Command blocks are on by default. If they do not work, someone turned the game rule off. Type in the console of the game panel:
gamerule command_blocks_work true
No restart is needed. Use false instead of true to turn them off.
Running 1.21.9 or 1.21.10?
In those two versions the game rule had a different name. Type /gamerule in chat and pick the rule with command in it from the suggestions.
Minecraft 1.21.8 and older
- Open your server in the game panel and stop it with Stop.
- Go to Files and open
server.properties. - Find the line
enable-command-block=falseand change it to:
enable-command-block=true
- Click Save Content and start your server with Start.
Get a command block
Command blocks are not in the Creative menu. Give yourself one with this command in chat:
/give @s command_block
Check
Place a command block, right-click it and enter a command, for example say Hello. Give the block a redstone signal. If the text appears in chat, it works.
Did this article help you?
Related articles
How do I change the Java version of my Minecraft server?
Every Minecraft version needs its own Java version. This is how you choose the right Java version for your Minecraft server in the game panel.
How do I change the version of my Minecraft server?
How to move your Minecraft server to a different version: download the jar from our mirror, replace server.jar and choose the right Java version.
How do I install mods on my Minecraft server?
How to install mods on your Minecraft server with Fabric: place the server launcher, add Fabric API and upload your mods to the mods folder.
Why does my Minecraft server crash?
Does your Minecraft server crash or not start? Find the error and fix the most common causes, from the Java version to plugins and memory.