I'm trying to make a couple of command blocks that are capable of emitting a redstone signal whenever the player jumps. I thought I would do it by constantly checking whether the Jump objective was the same as a dummy objective which always changes itself to the Jump objective.
To get to the point I need to set a dummy scoreboard objective called OldTotalJumps to an scoreboard objective which I've named TotalJumps. I have tried: scoreboard players set OldTotalJumps TotalJumps
but it keeps coming up with the error: "TotalJumps is not a valid number".
I hope someone can help.
Best Answer
There is a better way of solving your problem. Instead of creating a new dummy objective, you can simply reset the
jumps
objective to 0 every tick.You would need to run the following command once:
And these on a clock:
Of course you replace
do stuff
with the command/function you actually want to run.If you're still interested in solving the exact problem you posed, there is a different
/scoreboard
'subcommand' that can do that:operation
. The following command sets the command executor'soldtotaljumps
score to itstotaljumps
score.