I have a huge problem: I want to set a players HPLUranium
score to 9 whenever he wears an anti-radiation suit – easy, I do this like that:
scoreboard players set @p HPLUranium 9 {Inventory:[{Slot:103b,id:minecraft:leather_helmet,tag:{display:{Name:Nuclear Helmet,color:10066328}}},{Slot:102b,id:minecraft:leather_chestplate,tag:{display:{Name:Nuclear Tunic,color:10066328}}},{Slot:101b,id:minecraft:leather_leggings,tag:{display:{Name:Nuclear Pants,color:10066328}}},{Slot:100b,id:minecraft:leather_boots,tag:{display:{Name:Nuclear Boots,color:10066328}}}]}
But the problem is… how do I make him LOSE this 9 whenever it's not true? Like Conditional command block but opposite, command block that only runs when the one behind him say "false".
I tried to make command block repeating setting HPLUranium
to 0, and next to it Chain command block with command showed up there, but it was sometimes changing to 0 for… maybe a tick long when it should be 9, it may cause problems.
Any ideas how to run command if player IS NOT MATCHING DataTag?
Best Answer
Have a repeating command block with the following command and keep note of its coordinates:
Then, have another repeating command block with the following command, replacing X, Y, and Z with the coordinates of the first repeating command block:
and it will point to a last repeating command block set to
Conditional
with the following command:All command blocks should be set to
Always Active
.When the first command block fails, the second command succeeds because the
SuccessCount
is0
. This causes the third command block to activate, because conditional command blocks activate when a command block pointing into them succeeds.When the player is wearing the anti-radiation suit, the second command block will fail because
SuccessCount
will not be0
, and the player'sHPLUranium
score will not change.