mojira.dev
MC-295380

knockback_resistance attribute tooltip is improperly scaled

If you give yourself an item that has a knockback_resistance attribute modifier, The tooltip scales the modifier’s amount by 10.

Using the example command below, the tooltip says the item grants +5 knockback resistance, while in reality it grants 50% (flat) knockback resistance.

/give @s minecraft:phantom_membrane[minecraft:attribute_modifiers=[{id:"kbr",type:"knockback_resistance",amount:0.5,operation:"add_value",slot:"mainhand"}]]

Comments 1

Can confirm in 1.21.5-pre2, this has always bothered me. I rewrote the description to make it easier to read.

Putting aside the scaling issue for a moment, I would argue that knockback_resistance and explosion_knockback_resistance are the only attributes which players expect to read as a percentage and should therefore should have different tooltips. Whereas a regular tooltip should read eg.

operation

Output

Notes

add_value

+3 Attack Damage

add_multiplied_base

+300% Attack Damage

add_multiplied_total

+300% Total Attack Damage

Also a change request

a knockback resistance tooltip should read eg.

operation

Output

add_value

+30% Knockback Resistance

add_multiplied_base

+30% Knockback Resistance Potency

add_multiplied_total

+30% Total Knockback Resistance

The wording for the latter two operations isn’t ideal but in every scenario I can come up with the player would have to contend almost entirely with add_value operations- maybe one or two effects would make use of the multiplication operations, and they would essentially never be used in conjunction. For the average player, the improvement to comprehensibility would be significant, especially in vanilla, where players will be able to see that “this netherite helmet makes me take 10% less knockback“ as opposed to “this netherite helmet increases my knockback resistance by 0.1 (or 1, until this bug is fixed) in some unknown metric“.

Crazy_Waffle_Man

(Unassigned)

Confirmed

Commands

1.21.4, 1.21.5 Pre-release 2

Retrieved