mojira.dev
MC-71977

Changing generic.attack_damage of tamed wolf has no effect / taming wolf removes custom generic.attack_damage

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)

  1. Summon a wolf

  2. Tame it

  3. Change its attributes

    /data merge entity @e[type=wolf,limit=1] {Attributes:[{Name:generic.attack_damage,Base:20.0f}]}
  4. 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)

  1. Summon a wolf with a custom attribute

    /summon minecraft:wolf ~ ~ ~ {Attributes:[{Name:generic.attack_damage,Base:20.0f}]}
  2. 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

  3. Tame the wolf

  4. 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

Comments 36

Can confirm

Can a moderator resolve this? I would like this to be fixed soon.

Why isn't this resolved yet?

This has been ignored for a while.

Dlawso the Really Lucky Rabbit

Its not resolved because:

1. It "hasn't been fixed".

26 more comments

Can confirm in 1.19.2.

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.

Can confirm in 23w51b.

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.

Orbic

(Unassigned)

Confirmed

Platform

Low

Commands, Entities

Minecraft 1.7.10, Minecraft 14w34d, Minecraft 1.8-pre3, Minecraft 1.8, Minecraft 1.8.4, ..., 23w31a, 23w33a, 1.20.2, 23w51b, 24w05b

24w06a

Retrieved