Those of you who have done quite a lot of things with command blocks know that checking if commands are executed succesfully, and reacting to that, can be quite hard. I know comparators can check this, but there are a few things that comparators can't do, for example if you execute a command on a lot of entities at once, the comparator can't tell you on which entities the command had success.
That's why I'd like to add a small operator to commands, used optionally after commands like this:
/COMMAND1 ARGUMENTS.. ? COMMAND2 ARGUMENTS..
Or alternatively in this syntax:
/COMMAND1 ARGUMENTS.. succes COMMAND2 ARGUMENTS..
So, basically, you just add ? or "succes" after a command and it's arguments, and it would execute command2 if command1 was executed succesfully.
Now, you may wonder how it is different from just 2 command blocks with a comparator. First off, it would activate within the same tick and need no reset (comparators stay powered, which wouldn't execute the 2nd command if the first command block would execute it's command succesfully twice in a row witouth resetting the comparator). Secoundly, if the first command is executed multiple times (it uses @a or @e), it could then evaluate the succes of the first command for every entity it handles and execute the secound command for every succesfull execution of the first command.
/COMMAND1 ARGUMENTS.. succes COMMAND2 ARGUMENTS.. failure COMMAND3 ARGUMENTS..
And this would execute command2 for every succesful execution of command1, and execute command3 every time command1 failed.
To make this system more usefull, I also suggest the new target selector @l. It can't have any arguments between square brackets, and it will always act like the last entity processed by commands. So if you use @l in a 2nd command with the operator mentionned above and the first command processes a list of entities, the 2nd command will always execute on the exact same entities as the ones command1 executed on (succesfully), in the exact same order.
Those of you who have done quite a lot of things with command blocks know that checking if commands are executed succesfully, and reacting to that, can be quite hard. I know comparators can check this, but there are a few things that comparators can't do, for example if you execute a command on a lot of entities at once, the comparator can't tell you on which entities the command had success.
That's why I'd like to add a small operator to commands, used optionally after commands like this:
Or alternatively in this syntax:
So, basically, you just add ? or "succes" after a command and it's arguments, and it would execute command2 if command1 was executed succesfully.
Now, you may wonder how it is different from just 2 command blocks with a comparator. First off, it would activate within the same tick and need no reset (comparators stay powered, which wouldn't execute the 2nd command if the first command block would execute it's command succesfully twice in a row witouth resetting the comparator). Secoundly, if the first command is executed multiple times (it uses @a or @e), it could then evaluate the succes of the first command for every entity it handles and execute the secound command for every succesfull execution of the first command.
A syntax like this could also be usefull:
or in words:
And this would execute command2 for every succesful execution of command1, and execute command3 every time command1 failed.
To make this system more usefull, I also suggest the new target selector @l. It can't have any arguments between square brackets, and it will always act like the last entity processed by commands. So if you use @l in a 2nd command with the operator mentionned above and the first command processes a list of entities, the 2nd command will always execute on the exact same entities as the ones command1 executed on (succesfully), in the exact same order.
Any thoughts?