max_command_forks
integerJava 26.2 onlySets 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 102465536DefaultThe Minecraft default.
Java
/gamerule max_command_forks 655361000000PermissiveVery high fork limit for complex function packs.
Java
/gamerule max_command_forks 1000000Default: 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.