The bug
Changing the generic.attack_damage
attribute of a tamed wolf does not appear to have any effect. Similarly taming a wolf with a custom generic.attack_damage
attribute value changes it to the default.
This does not affect the Strength potion effect in the latest game versions when applied with potions or /effect
; summoning a mob with ActiveEffects
is MC-32575.
See MC-193202 for the health of a wolf resetting.
Reproduction steps (modifying attribute)
Summon a wolf
Tame it
Change its attributes
/data merge entity @e[type=wolf,limit=1] {Attributes:[{Name:generic.attack_damage,Base:20.0f}]}
Let it attack an entity (by punching that entity) or inspect its NBT data
/data get entity @e[type=wolf,limit=1,sort=nearest] Attributes
❌ It has the default
generic.attack_damage
Reproduction steps (taming wolf with custom attribute)
Summon a wolf with a custom attribute
/summon minecraft:wolf ~ ~ ~ {Attributes:[{Name:generic.attack_damage,Base:20.0f}]}
Inspect its NBT to make sure it has the custom attribute
/data get entity @e[type=wolf,limit=1,sort=nearest] Attributes
✔ It shows the custom attribute
Tame the wolf
Let it attack an entity (by punching that entity) or inspect its NBT data
/data get entity @e[type=wolf,limit=1,sort=nearest] Attributes
❌ It has the default
generic.attack_damage
Code analysis
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 4
relates to 2
Comments 36
This issue happens because wolves change their attribute base values when being tamed rather than using Attribute Modifiers (like shulkers when closing; baby zombies;...). Changing wolves to use them would fix this issue.
Coming from issue MC-73411, this is very much still an issue in 1.20.1, and no amount of finagling seems to be able to bypass it. Even once the mob exists, you still cannot modify the base attack damage of the rabbit with a /data modify or merge, and weakness potions etc. have no effect.
Data merge for reference:
/data merge entity @e[type=rabbit] {ActiveEffects:[
{Id:18,Amplifier:100b,Duration:2000,ShowParticles:1b}
]}
/data modify entity @e[type=rabbit,limit=1] Attributes[
{Name:"generic.attack_damage"}].Base set value 1
Both of these commands "work", and particle effects will be applied, but the attack damage stays the same.
This issue is still occurring for certain passive mobs like the killer bunny. Status effects such as negative strength, or changes to generic attack damage have no effect on how much damage the mob does. This is easily reproduceable in 1.21. Here's a command:
/summon rabbit ~ ~ ~ {Health:15f,RabbitType:99,Tags:["boss1"],active_effects:[{id:"minecraft:strength",amplifier:-2,duration:10000}],attributes:[{id:"minecraft:generic.attack_damage",base:1},{id:"minecraft:generic.max_health",base:15}]}
Regardless of what values you choose, generic attack damage cannot be set or modified.
Can confirm