Compare
Arguably the most powerful and most technical GooP Command
Compares two things, then changes a player's scoreboard.
/goop compare <player> <objective> <score> {Something} GC_<operator> {Anything}
Since it parses PAPI Placeholders, any plugin that supports PAPI can now communicate with any plugin that reads scoreboards.
You may even choose a math operation keyword instead of a number for <score>; To perform math operations!
Will not do anything if anythng doesnt match something under the operation.
Args Breakdown (What everything does)
<Player>
Player used to parse PAPI placeholders, and whose score will be changed.
Supports a few vanilla selectors.
<Objective>
Scoreboard objective where the score result will be stored
<Score>
The numeric value that will be set if the {Something} matches {Anything}
If both {Something} and {Anything} are numeric, you can use these keywords:
difference The result of {Something}-{Anything}
sum The result of {Something}+{Anything}
product The result of {Something}*{Anything}
division The result of {Something}/{Anything}
power The result of {Something}^{Anything}
root The {Anything}th root of {Something}
cos The Cosine of {Something} (degrees)
sin The Sine of {Something} (degrees)
tan The Tangent of {Something} (degrees)
arcCos The ArcCosine of {Something} (degrees)
arcSin The ArcSine of {Something} (degrees)
arcTan The ArcTangent of {Something} (degrees)
{Something}
Any string, even containing PAPI placeholders.
If you know its going to be numeric, you can perform math operations!
GC_<Operator>
Operation by which to compare {something} to {anything}.
Remember that the score will only change if they 'match' by this operaton.
Supported Operations (that you may combine with each other):
= They must be equal, will parse numeric placeholders automatically, or the strings must be identical.
> If {Something} exceeds {Anything}. Will fail if even one isnt numerical.
< If {Something} is less than {Anything}. Will fail if even one isnt numerical.
S will force comparing as text, so 0.00 GC_S= 0.0 will fail though they are numerically equal
C will ignore capitalization, so YeS GC_C= yes will succeed.
! will run the comparison as if it wasn't there, and then invert the result - change score if they dont match.
{Anything}
String to compare to {something}, even containing PAPI placeholders.
If you know its going to be numeric, you can perform math operations!
Tips
Use %player_score_OBJECTIVE% to read the up-to-date score of a player.
For some reason, PAPI placeholder %objective_score_OBJECTIVE% lags behind and always gives you the score the player had at the beginning of the GooP command chain.
GooP Commands usually have the option to change a scoreboard based on their result:
This allows any plugin that reads scoreboards to detect this change.
Since any plugins that run commands can use GooP, then, GooP can be used as a messenger between the two plugins.
Use /goop compare <player> OBJECTIVE sum %some_numeric_placeholder% GC_E<=> 0 to set the player's score to the value of a placeholder. Note that decimal places are lost because scores are integers.
Use /goop compare <player> OBJECTIVE sum %some_numeric_placeholder% GC_<=> 0 to do the same thing, but multiplies score by 100, keeping two decimal places.
If you dont include E in your operator, GooP will multiply by 100 automatically (to keep two decimal places).
When you only want to perform math operations, just use GC_<=> as your operator and it will only fail if one of the strings is not numerical (basically always perform the math operation).
You can combine operators in any order, so that
GC_<>= is the same as GC_=>< or whatever.
Simple Examples:
/goop compare cocopad myObjective 2 5.0 GC_=> 5.00
Will set cocopad's score to 2, because 5 is greater than or equal to 5
/goop compare cocopad myObjective 2 5.0 GC_S= 5.00
Will not set cocopad's score to 2, because 5.0 is not the same text as 5.00
/goop compare cocopad myObjective 2 5.0 GC_= 5.00
Will set cocopad's score to 2, because 5 does equal 5.
/goop compare cocopad myObjective 2 Potato GC_= potato
Will not set cocopad's score to 2, because of capitalization issues
/goop compare cocopad myObjective 2 Potato GC_C= potato
Will set cocopad's score to 2, despite capitalization differences
/goop compare cocopad myObjective 2 5 GC_!= 2
Will set cocopad's score to 2, because 5 is not equal to 2
/goop compare cocopad myObjective 2 %mmocore-mana% GC_=> 20
Will set cocopad's score to 2 if they have at least 20 mmocore mana.
/goop compare cocopad myObjective sum %mmocore-mana% GC_E<=> 0
Will set cocopad's score to the mmocore mana they have, which is the result of adding their mana to zero.
/goop compare cocopad myObjective difference 10 GC_E<=> 2.55
Will set cocopad's score to 7, which is the result of substracting 2 from 10 (7.45), rounded.
/goop compare cocopad myObjective difference 10 GC_<=> 2.55
Will set cocopad's score to 745, which is the result of substracting 2 from 10; multiplied by 100 to keep two decimal places.
Comment from the Dev:
I remember that day I was defeated at 2am tyring to execute the Cosine function in minecraft using only vanlla operations.
A month later, I learned how to Taylor expand shit in AP Calculus BC class, and returned to finally succeed in that.
No more need to taylor expand stuff though, a shame no one will get to feel as triumphant as I once did.