Skip to content
[/craft]

max_command_sequence_length

integerJava 26.2 only

Sets the maximum number of commands that can execute in a single function chain before it terminates. Prevents infinite loops inside function files from hanging the server.

Common values

1024StrictCuts off function chains at 1,024 commands.
Java/gamerule max_command_sequence_length 1024
65536DefaultThe Minecraft default.
Java/gamerule max_command_sequence_length 65536
1000000PermissiveVery high limit for large function libraries.
Java/gamerule max_command_sequence_length 1000000

Default: 65536. Restore with /gamerule max_command_sequence_length 65536

What max_command_sequence_length does

Sets the maximum number of commands that can execute in a single function chain before it terminates. Prevents infinite loops inside function files from hanging the server.

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

Related gamerules

All Gamerule commandsJava vs Bedrock guide