Disclaimer: this suggestion is based around the updates recently made in the 1.12 snapshots that make command block loops and if/else-style conditionals possible. You'll probably want to know a bit about those updates to better understand this suggestion (the tl;dr is that you can now change the direction a chain is going while it's running, and you can run individual command blocks more than once in a single tick). Also, being a programmer would be useful, since I can't guarantee I'm very good at explaining things, especially without any Big and Programming Jargon words!
Essentially I'm suggesting a command – we'll call it /activate
– that does the following:
-
Activates an impulse command block at the given position. This impulse block would run immediately – as soon as the
/activate
command is executed. -
Waits for any chain blocks following that impulse block to be complete.
-
Proceeds with the rest of the command block chain
/activate
is part of (if any).
The most important thing is that this would all run without costing any ticks at all. Currently, there's two ways of remotely activating a command block:
-
Use
/setblock
to place a block of redstone next to the impulse command block. -
Use
/blockdata
to change the impulse command block to be{auto: 1b}
– that is, so that it runs without needing redstone. The impulse command block changes itself to require redstone (/blockdata ~ ~ ~ {auto: 0b}
) so that it can run again later.
The trouble is, both of these only permit the command block to be run next tick. The command block won't run immediately, which will thus enforce a delay in your code – often a delay that's too costly to make these ways of remotely powering command blocks usable.
But what's the point? What does this make possible?
Most simply, it would let you write the code you do for things often just once.
For example, you could make a "procedure" (most programming languages call these "functions") that adds a tag to every player with at least 30 zombie kills, 10 skeleton kills, and 40 spider kills. Then you could use /activate
to run the command blocks that make up that procedure. That would make the procedure run, and after, you could use that tag for any purpose you like, such as such as /tell
ing them that they've finished the quest. Later on you could use /activate
to activate that procedure again, but this time you could do something else with the tagged players – like giving those tagged players items as rewards for the quest, or marking off an advancement.