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"}]]

Linked issues

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 have different tooltips. Whereas a regular tooltip should read eg.

operation

Output

Notes

add_value

+3 Attack Damage

add_multiplied_base

+300% Base Attack Damage

Also a change request

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% Base Knockback Resistance

add_multiplied_total

+30% Total Knockback Resistance

While this would not resolve all the comprehensibility issues with KBR tooltips, considering that only add_value is used for KBR in vanilla, the improvement would be significant for the average player. Players would 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, 1.21.11 Pre-Release 3

Retrieved