Skip to content
[/craft]

max_command_forks

integerJava 26.2 only

Sets the maximum number of execution forks in a single function call or command chain. A fork occurs when a command runs multiple times (e.g., /execute as @a forks once per player). Lowering this protects against runaway command loops.

Common values

1024StrictOnly 1,024 forks per chain.
Java/gamerule max_command_forks 1024
65536DefaultThe Minecraft default.
Java/gamerule max_command_forks 65536
1000000PermissiveVery high fork limit for complex function packs.
Java/gamerule max_command_forks 1000000

Default: 65536. Restore with /gamerule max_command_forks 65536

What max_command_forks does

Sets the maximum number of execution forks in a single function call or command chain. A fork occurs when a command runs multiple times (e.g., /execute as @a forks once per player). Lowering this protects against runaway command loops.

max_command_forks is a Java Edition-only gamerule and is not available in Bedrock.

Related gamerules

All Gamerule commandsJava vs Bedrock guide