Mojira Archive
MC-277323

attribute modifier operation types work incorrectly

The operation type add_multiplied_base behaves as if it was add_multiplied_total.
How to recreate:
1. create a new world in the specified version and add yourself an attribute modifier like this:

/attribute @s minecraft:armor modifier add armor1 1 add_value

This will create a new attribute modifier and add it to you. Use the command

/attribute @s minecraft:armor get

to retrive the calculated attribute value. It should be 1.

2. add your self a second attribute modifier like this:

/attribute @s minecraft:armor modifier add armor2 1 add_multiplied_base

Use the command

/attribute @s minecraft:armor get

to retrive the calculated attribute value.

What should happen:
The base of the minecraft:armor attribute is 0.0d by default. This means that when adding a value that was multiplied by this base it should always add 0. Therefore result should be 1.

What actually happens:
The modifier uses the total value of the attribute which is 1.0d and multiplies it by 1. It then adds the value to the attribute resulting in a total value of 2.0d. Therefore the result is 2.

Works As Intended

Nuclearinferno

2024-10-05, 09:30 PM

2024-10-17, 06:52 AM

2024-10-15, 07:07 AM

1

2

Confirmed

(Unassigned)

24w40a

-