Guide · Configuration

How to enable command blocks on a server

Command blocks are off by default on servers. If you see "Command blocks are not enabled on this server", here is how to turn them on for your Minecraft version.

Minecraft 1.21.9 and newer

The setting moved from server.properties to a game rule. On 1.21.11 and newer, including 26.x, run gamerule minecraft:command_blocks_work true. On 1.21.9 and 1.21.10, use tab completion after typing gamerule to find the command block rule, as the name changed again in 1.21.11.

Minecraft 1.21.8 and older

Set enable-command-block=true in server.properties with the server stopped, then start it again.

Getting and using a command block

Command blocks cannot be found in survival or the creative inventory. As an operator in creative mode, run /give @s command_block. Placing and editing them requires creative mode and operator level 2 or higher, which the default op-permission-level of 4 includes.

  • Impulse: runs once when powered
  • Chain: runs after the block pointing into it
  • Repeat: runs every tick while powered, so use sparingly

Performance and safety

Repeating command blocks run every tick, and heavy commands such as broad entity selectors in many repeating blocks can cost real TPS. Functions in a datapack are usually cleaner and easier to manage than walls of command blocks. Only operators can edit command blocks, so they are not a griefing risk on their own, but be careful who you make an operator.

StormNodes Minecraft hosting

Run it on a StormNodes server

Skip the port forwarding and the PC that has to stay on. A StormNodes Minecraft server is online in minutes, and everything in this guide can be done from the panel.

  • Hosted in Portugal, close to players across Western Europe
  • NVMe storage, monthly billing and no setup fee
  • Paper, Purpur, Fabric and vanilla, switchable from the panel
  • Live console, file manager, SFTP, backups and schedules
  • Support in English and Portuguese

FAQ

Frequently asked questions

Why is enable-command-block missing from server.properties?
It was removed in 1.21.9 and replaced with a game rule. Use the gamerule command instead.
Can non-operators use command blocks?
Players can trigger them with buttons or pressure plates, but only operators in creative mode can place or edit them.
Do command blocks cause lag?
Impulse and chain blocks are cheap. Many repeating blocks with expensive selectors can lower TPS; move that logic into a datapack function where possible.