Skip to content

2 Store

HydraheadHunter edited this page Jul 20, 2024 · 2 revisions

The Store mood reads a target's stats and writes it to a scoreboard objective (for that target) for later use.

statistics store [@p] [stat type] [stat] [scoreboard objective] [? unit]

Arguments

Store takes the standard three arguments: player target(s), stat type, stat. It additionally takes a scoreboard objective.

Optionally it can take a unit.

Scoreboard Objective

The scoreboard object you want the mod to store the stat's value in. The objective must exist before running the command or the command will fail.

You can create a scoreboard objective using the vanilla command scoreboard objectives add [objective_name] dummy. You can use variations on the vanilla command scoreboards objectives setdisplay ... to make it pretty.

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, store checks the requested stat's value, and writes it to that targets scoreboard in the specified objective. And provides feedback if entered through chate. When it finished doing that for all targets, it returns the sum of all stats stored.

If it cannot find a player, a stat, scoreboard objectives or otherwise incurs an error, it returns -1.

With Units

When given a string as a unit, it will check if that string can be parsed as a unit, if that unit make sense for the stat being checked. If no to either, it will provide feedback about the error and return -1 early. If yes to both, it will perform as normal but will divide the stat by the specified unit's conversion factor (and round down) before storing the value and providing feedback. The value it returns is still based on the raw values of all stacks checked.

Clone this wiki locally