Skip to content
HydraheadHunter edited this page Jun 30, 2024 · 1 revision

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]

Arguments

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.

Int (Optional)

A positive whole number.

Scoreboard Objective (Optional, Replaces Int)

A scoreboard objective.

Unit (Optional)

Unit is a string word argument which is associated with a conversion factor (eg, an in is 2.54 cm).

Function

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.

With Int

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

With Scoreboard Objective

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.

With Units

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.

Clone this wiki locally