Variables
Variables store values that can be read and updated across block stacks and scripts.
Variable command blocks
Set variable to
Sets selected variable to the specified value.
- Type: command block
- Typical use: initialize state, overwrite previous value
Change variable by
Adds the specified amount to selected variable.
- Type: command block
- Typical use: counters, score, accumulated distance/time
Variable value reporter
Returns the current value of the selected variable.
- Type: reporter block
- Typical use: use variable value inside operators, conditions, and command inputs