Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-267410

Attribute command's multiply modifiers are misleading

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Works As Intended
    • None
    • 1.20.4, 23w51b
    • None
    • Confirmed
    • Commands

      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

            Unassigned Unassigned
            LateLag [Mod] LateLag
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: