Mojira Archive
MC-267410

Attribute command's multiply modifiers are misleading

The /attribute command allows you to apply modifiers of 3 different kinds: add, multiply and multiply_base.

The add mode behaves exactly like you'd expect. If the current value of the attribute is [x] and you want to add [y], the new value will be [x + y].

The issue is with the two other modes, multiply is not as straightforward. With a name like that, you'd expect the game to multiply the two numbers and set the product as the new value, which would be [xy]. However, the game adds the result of the multiplication on top of the current value, making it [x + xy] instead. The multiply_base mode behaves the same, except [x] is the base value of the attribute instead of the current one.

Steps to Reproduce:

  1. Run the command /attribute @s minecraft:generic.attack_damage get to check the current value of the attribute "Attack Damage"
    The current value is 1.0
  2. Run the command /attribute @s minecraft:generic.attack_damage modifier add 00000000-0000-0000-0000-000000000000 test 2.0 multiply
  3. Check the value of the attribute once again.

Observed Results:
The new value is 3.0

Expected Results:
The new value is 2.0

Works As Intended

[Mod] LateLag

2023-12-18, 07:26 PM

2024-04-10, 05:46 PM

2024-01-10, 08:03 AM

2

3

Confirmed

Commands

1.20.4, 23w51b

-