/[goop command] oS= <any command>
Using the keyword oS=, on the success of a GooP command, everything after it will run as the same command sender.
You may use @s selector to target the same player that was targetted in the command before.
You may also use the custom slot selector @t to specify the slots that succeeded previously.
To use this feature, one must simply write oS= in their command. It only works when called from GooP commands.
Will only run the remaining commands if the current one succeeds. Like chained command blocks.
If its not intuitive, you can tell apart command successes from failures by having only either sendSuccessFeedback or sendFailFeedback gamerules enabled, and also blockErrorFeedback enabled.
oS= stands for On Success, if you want to read it better.
Sometimes, you are using a command like goop testinventory through the whole inventory:
goop testinventory %player% *
However, you want to easily know which slots succeed with it, in that case @t is for you:
goop testinventory %player% * m CONSUMABLE MANGO comp oS= goop nbt setAmount @s @t -1
Where @s is the player, and @t is the slots from their inventory that cause the command to actually succeed. This command will reduce the amount of all mango stacks in the player's inventory by 1.
/goop testinventory gunging mainhand v SPONGE 0 dummy 1 oS= goop grief l @s ~ ~ ~ ~ 4
Will set the player gunging's score dummy to 1 if they are holding a sponge. Otherwise, nothing will happen. However, if the player is holding a sponge, the stuff after oS= will run, drying the liquids within 4 blocks of gunging.
/goop consumeitem %player% m CONSUMABLE PIRATE_KEY 1 oS= broadcast @s has used a Pirate Key!
Will consume one pirate key from the target player. If a key was found and consumed, it will then broadcast a message.
/goop nbt adamage cocopad mainhand +2 oS: goop nbt mhealth @s mainhand +2 oS: goop nbt aspeed @s mainhand +10%
Will apply three buffs to cocopad's held item (+2 attack damage, +2 max health bonus, 10% more attack speed). NBT commands rarely fail, so this is basically a way to run three commands in one (Well, this would fail if cocopad is holding air).
The colon and equals can be used intercheangeably.
/goop nbt setItem atuosto mainhand v diamond_sword 0 oS: goop nbt adamage @s mainhand 1337 oS= goop nbt mhealth @s mainhand 50 oS: goop nbt mspeed @s mainhand 0.2 oS= goop nbt luck @s mainhand 8 oS: goop nbt addLore top @s mainhand &4F&ci&6l&el&a t&bh&9e&5 w&4o&cr&6l&ed&a w&bi&9t&5h&4 c&co&6l&eo&ar&b!&9!&5! oS: goop nbt addLore bottom @s mainhand &8Gunging was here oS= goop nbt rename @s mainhand &r&f✩ &4S&cp&6e&ec&at&2r&bu&3m &1B&9l&5a&dd&4e &f✩ oS: say Why do seagulls fly over the sea? Because if they flew over the bay, they'd be bagels! oS:oop
Will transform the item player atuosto is holding into an epic sword with a rainbow name, and also broadcast a bad joke.
Bug Notice regarding Slots of Success
When targetting multiple targets, lets say, @a (everyone in the server), lets say you testinventory them in search for vanilla APPLE, with the aim of renaming all apples 'Cool Apple':
goop testinventory @a * v APPLE 0 oS: goop nbt rename @s @t &3Cool Apple
The command to rename only runs for those players that had at least one apple in their inventory, since @s picks those for which the first command succeeded.
From all the slots (* keyword), @t will pick out all that succeeded from all players.
If a player A is holding an apple in their hand, and another player B with apples in his inventory is holding their sword, the sword of player B will be renamed Cool Apple; which is unintended.
To prevent this, only use @t when targetting only one player.
One day I'll fix it but right now theres a lot to do. Be aware of it.
Not adding on fail oF: ever. It would make this sintax insanely complicated (to correctly account for all the possible branching).
Use a mythic skill if you really want such a structure, and sudo it with Run Skill As.
Instead, try Fail Messages page actually.