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 install mods on my Minecraft server?
How to install mods on your Minecraft server: switch your server to Fabric in the client portal, add Fabric API and upload your mods.
How do I install a modpack on my Minecraft server?
How to put a modpack on your Minecraft server with the modpack installer in the game panel: CurseForge, Modrinth, Feed The Beast and more.
How do I change the version of my Minecraft server?
How to switch Minecraft version or server type through the Reinstall tab in the client portal. Your world and plugins stay in place.
Why can't I connect to my Minecraft server?
Cannot connect to your Minecraft server? Go through the most common causes: server off, wrong address, different version, whitelist or mods.