Minecraft: Swapping two scoreboard values

Solution 1:

This can be accomplished using /scoreboard players operation:

/scoreboard players operation <target1> <objective1> <operation> <target2> <objective2>

The available operations are:

  • += Addition: increase first first score by second
  • -= Subtraction: decrease first first score by second
  • *= Multiplication: multiply the first score by the second
  • /= Integer Division: divide first score by second
  • %= Modular Division: set first score to the remainder when it's divided by the second
  • = Assign: set first score to the second
  • < Min: set first score to the min of either score
  • > Max: set first score to the max of either score
  • >< Swap: swaps the scores around

What you want to do should be:

/scoreboard players operation @p Reg1 = @p Reg2