-
Notifications
You must be signed in to change notification settings - Fork 0
2 Add
The Add mood changes it's targets stats by increasing them. If it was executed through the chat, it will provide the executor with feedback showing the stat's new value.
statistics add [@p] [stat type] [stat] [? int | scoreboard objective] [? unit]
Add takes takes the standard three arguments: player target(s), stat type, stat.
Optionally, it can take an int or scoreboard objective, after which it can also take a unit.
A positive whole number.
A scoreboard objective.
Unit is a string word argument which is associated with a conversion factor (eg, an in is 2.54 cm).
For each of its targets, Add will increase the requested stat's value by one. When it finished it will return the sum off all stat increases. If it cannot find a player, a stat, or otherwise incurs an error, it returns -1.
The request stat will be increased by the value of the int instead of one. Notable this means that the following two commands are functionally identical:
statistics add @p custom minecraft:jumped
statistics add @p custom minecraft:jumped 1
The command will read the scoreboard objective's value for each target and use that to variably increase the requested stat by the target's score.
Notably, this means that all score could be increased by zero.
When given a string, it will check if that string can be parsed as a unit, if that unit make sense for the stat being modified. If no, it will return provide feedback about the error and return -1 early. If the unit can be parsed and is sensical, it will multiple the value of the preceding argument by the unit's conversion factor while modifying the stat and give unique feedback.
When finished, the return value will still be the sum of all increases made.