2

Say I have the objective test which is stat.killEntity.Zombie. I also have another objective test2 which is also a stat.entityKilledBy.Zombie. Can I make a new objective, which is a dummy, and the value of that is test + test2. Is this possible? If not, what is the best alternative?

5

The /scoreboard command allows you to perform operations with player's scores.

To make it so that test3 = test + test2 for all online players, do something like this:

execute @a ~ ~ ~ scoreboard players operation @p test3 = @p test
execute @a ~ ~ ~ scoreboard players operation @p test3 += @p test2

That makes everyone set their test3 score to their test1 score, and then add onto that their test2 score.

This is only sets their test3 score once (it won't automatically always be test + test2 now), so you'll need to do this on a clock or just before you /testfor a certain test3 score.

| improve this answer | |
  • Mind blown. Wow. – 54D Aug 30 '15 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.