MPL icon indicating copy to clipboard operation
MPL copied to clipboard

Simple comparison of scores for if and loops

Open BrainStone opened this issue 9 years ago • 0 comments

Having simple comaprisons in conditions would be amazing!

Something like this:

if: selector1 score1 <= selector2 score2

would become

/scoreboard players operation selector1 score1 -= selector2 score2
/scoreboard players test selector1 score1 * 0
/scoreboard players operation selector1 score1 += selector2 score2

Then just apply the if logic to the second command.

Scoreboard-Test-Commands for all comparison operators:

<= -> * 0 < -> * -1 >= -> 0 * > -> 1 * == -> 0 0 != use the == logic and invert the condition. (if: a b != c d becomes not if: a b == c d and vice versa)

BrainStone avatar May 04 '16 22:05 BrainStone