Description:
This issue relates to item tooltips. If an item has the attack_damage
and attack_speed
attribute modifiers with the add operation, and the attribute IDs are minecraft:base_attack_damage
and minecraft:base_attack_speed
, respectively. The tooltip will display the player’s total attack_damage
and attack_speed
values in green text (without the +
symbol), just like any vanilla combat item.
However, the attack_damage
tooltip value does not use the player’s actual stats for calculation.
Steps to Reproduce:
Run the following commands:
/attribute @s minecraft:attack_damage base set 10
/attribute @s minecraft:attack_speed base set 10
Give yourself an item with
attack_damage
andattack_speed
attribute modifiers, using theminecraft:base_attack_damage
andminecraft:base_attack_speed
IDs:
/give @a minecraft:stone_sword[attribute_modifiers=[{type:attack_damage,amount:5,id:"minecraft:base_attack_damage",operation:add_value},{type:attack_speed,amount:-5,id:"minecraft:base_attack_speed",operation:add_value}]]
Check the item’s tooltip.
Check the attribute values with:
/attribute @s minecraft:attack_damage get
/attribute @s minecraft:attack_speed get
Compare the results from the commands with the tooltip shown on the item.
Expected Result:
Total
attack_damage
= 15 (10 base + 5 item modifier), confirmed by the/attribute get
command.Total
attack_speed
= 5 (10 base – 5 item modifier), confirmed by the/attribute get
command.
The tooltip should display the player’s actual total attack_damage
(in this case, 15), consistent with how the attack_speed
tooltip correctly reflects the real value with modifiers applied.
Observed Result:
The tooltip for
attack_damage
displays 6, calculated as 1 (hardcoded base) + 5 (modifier).It ignores the player’s actual base attribute value.
The
attack_speed
tooltip is displayed correctly (in this case, 5).
Notes:
This behavior is inconsistent. If the tooltip is intended to represent only the weapon’s damage, there is no reason to include the hardcoded 1
. Otherwise, it should correctly calculate and display the player’s total attack damage with the item equipped.
Linked issues
is duplicated by 2
relates to 1
Attachments
Comments 22
MC-113552 relates to items with custom modifiers (Acquired via commands) displaying those modifiers instead of the player's actual stats. This issue relates to unmodified vanilla items (Acquired via Survival gameplay or Creative Inventory) displaying incorrect values, specifically the Attack Damage attribute.
Players have a base Attack Damage of 1, this is why you can punch mobs with a bare hand and deal 1 damage. With a Wooden Sword, players deal 4 damage. 4 - 1 = 3, so a Wooden Sword adds 3 Attack Damage.
It isn't a duplicate of MC-113552