Plus Minus Percent

A short hand for an operation [±]<operation constant>[%]

Compactly set, add, substract, and multiply! Used basically everywhere in GooP where numbers are involved.

Basic Sintax

Before saying anything, suppose original number is 200. We will perform the operations on this number


Adding

Adding to the original value is defined by using the + prefix, if you dare call it like that.

  • +10 => 200 + 10 => 210

  • +500 => 200 + 500 => 700


Substracting

Substracting, intuitively, then requires the - prefix/symbol:

  • -10 => 200 - 10 => 190

  • -500 => 200 - 500 => -300


Setting

Setting to a value completely ignores the original number. You will specify this with a simple number, no symbols nor anything.

  • 10 => 10

  • 500 => 500

But what about negative numbers? If you tried to set to -500, you'd end up substracting 500 per the rule above. For this situation, setting to a negative number will require n prefix/symbol:

  • n10 => -10

  • n500 => -500


Multiplying

That you will multiply is specified with the prefix %, which also implies a division by 100:

  • 10% => 200 × (10 ÷ 100) => 20

  • 500% => 200 × (500 ÷ 100) => 1000


Combined Sintax

You can use both a prefix and a suffix to perform operations. Which bascially means you can add a prefix to multiplying:


Flip Multiplication

Will multiply normally, but will also flip the sign of the original value. Its literally multiplying by a negative number:

  • n10% => 200 × (-10 ÷ 100) => -20

  • n500% => 200 × (-500 ÷ 100) => -1000


Percent Bonus

Rather than just multiplying the original value by the percent, it will increase it by that much.

  • +10% => 200 + [200 × (10 ÷ 100)] => 220

  • +500% => 200 + [200 × (500 ÷ 100)] => 1200

These are mathematically identical as adding 100 to the operation value instead of using the + prefix.

  • 110% => 200 × (110 ÷ 100) => 120

  • 600% => 200 × (600 ÷ 100) => 1200


Percent Deduction

IRather than just multiplying the original value by the percent, it will decrease it by that much.

  • -10% => 200 - [200 × (10 ÷ 100)] => 180

  • -500% => 200 - [200 × (500 ÷ 100)] => -800

Simple Examples:

/goop testinventory gunging mainhand v SPONGE 0 dummy +1

Will increase gunging's dummy score by one if they are holding a simple sponge.


/goop nbt adamage cocopad mainhand +40%

Will permanently increase the attack damage attribute of cocopad's held weapon by 40%.


/goop nbt setItem atuosto offhand m CONSUMABLE MANGO 50%

Suppose atuosto is holding 40 items in their offhand, these will be replaced by half that many (20) mangos.