In the beta, there are two gamerules that can suppress commands going out of control: maxChainCommandLength and functionCommandLimit. I'd like to propose a single gamerule that handles both. Here is my reasoning:
Currently, a function in a command block only counts as 1 command towards the maxChainCommandLength gamerule, even if that function runs five thousand commands. That means that in practice, you can run a number of commands equal to the product of the two gamerules. By default, that is the ridiculous number of 655,350,000! Hardly seems like these gamerules are limiting commands effectively.
When utilized correctly, functions are vastly more efficient than command blocks chains. This mostly stems from the ability to use @s in normal commands, reducing the overhead of scanning entities with @e. To improve performance, functions are the responsible form of commands. So why have a gamerule that throttles them specifically? Yes, branching done wrong can cause tons of commands to run, and we do want to stop that. So here is my proposal:
Make functions and chains count towards maxChainCommandLength, and remove functionCommandLimit altogether. When a command block runs a function, it should count as not one command, but the number of commands that were run by that function total.
This way, the single gamerule can be used to say "This is the single definitive limit for how many commands this world can run." Right now, it's murky and you can have chains or functions throttled more heavily for seemingly no gain.
Please sign in to leave a comment.
2 Comments