You can use scoreboard operations to add one score to another.
/scoreboard players operation <affected_target> <affected_objective> <operation> <target> <objective>
Operations available: +=
, -=
, *=
, /=
, %=
, <
, >
, ><
, =
More information concerning scoreboards can be found here.
Prerequisites:
You will need another objective to hold the value:
/scoreboard objectives add stonetotal dummy
Clock commands:
The following must be run in numerical order on a clock.
Reset all player's "stonetotal" score to 0. Without this, their score will constantly increase.
/scoreboard players set @a[score_stonetotal_min=1] stonetotal 0
Cause all players to run the /scoreboard
command, targeting their own scores. They will increment their "stonetotal" score equal to their respective stone scores.
/execute @a ~ ~ ~ /scoreboard players operation @a[c=1] stonetotal += @a[c=1] stonecounter
/execute @a ~ ~ ~ /scoreboard players operation @a[c=1] stonetotal += @a[c=1] stonebrickcounter
/execute @a ~ ~ ~ /scoreboard players operation @a[c=1] stonetotal += @a[c=1] cobblestonecounter