While functions are quite versatile, one major drawback is that when you run a function you can not abort it halfway through. This simple command could be used to break loops and to optimize larger datapack-based mods by cutting out extra command executions if they are deemed unnecessary.
When a "/stopchain" command is run, the command succeeds. If it is run by a command block, it will not activate the next block in the chain. If it is run by a function, it will immediately abort the function, skipping the rest of the commands after it. If it is a function being called within another function, it would only stop the function it is called in and return to the previous function. Alternatively, you might be able to use an optional argument to specify a number of layers to stop. This would just repeat the command multiple times.
A /stopchain command will fail if it is run with nothing to stop.This will happen if it is executed as an entity or run via the server console.
Please sign in to leave a comment.
3 Comments