mojira.dev
MC-60843

>, <, and >< outputs Successful when no operation occurs

When using the operation command, if you use the operation >, <, or ><. Even though the execute will only execute if the operation is successful, the SuccessCount is always true if the operation was successful. By doing this, there is still no easy way to detect if a value is less than a value. CommandStats also outputs a value of 1

How to reproduce:
/scoreboard objectives add Test dummy
/scoreboard players set LessScore Test 1
/scoreboard players set MoreScore Test 10
/scoreboard players operation MoreScore Test > LessScore Test

Output: Operation applied successfully, but the amount of one has not been added to LessScore. Ensure a comparator is attached to see that no matter what happens, a redstone signal is outputed.

If this was intended, think about making it a feature. You would be able to easily test of a score is less than or equal to another score and then if it is, run other commands. The only way to do this currently is to actually use the comparator for its original use by putting one input on one side, and the other on the other side.

Comments 2

If Mojang does not want to go this route, they could add a feature to scoreboard players test to test between two objectives for >, <, =, or ><. It would be a very nice addition to the amazing features that 1.8 is adding.

The operations < and > are actually not "less than" or "greater than", they are min and max and work as follows:

if (operation.equals("<"))
score1.setScore(Math.min(score1.getScore(), score2.getScore()));

if (operation.equals(">"))
score1.setScore(Math.max(score1.getScore(), score2.getScore()));

Dakotah Intriglia

michael

Unconfirmed

Minecraft 14w26c, Minecraft 14w27b

Retrieved