TransWikia.com

How do I do multiply scoreboard values?

Arqade Asked by Wii Craft on July 19, 2021

How do I make a command that basically sets var1 = var2 * var3?

Is there a way to do this in minecraft 1.8.8?

One Answer

What you are looking for can be done via the aptly named scoreboard players operation set of commands.

scoreboard players operation <targetName> <targetObjective> <operation> <selector> <objective>

This sets <targetName>'s score in <targetObjective> based on <selector>'s score in <objective>, according to the <operation>.

The latter can be any of += (add), -= (subtract), *= (multiply), /= (divide), %= (modulo), = (set), < (min), > (max) or >< (swap).

In order to set var1 = var2 * var3 for "target", you can run two commands:

scoreboard players operation <target> var1 = <target> var2
scoreboard players operation <target> var1 *= <target> var3

Correct answer by MrLemon on July 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP