mojira.dev
MC-199350

Wild wolves deal 4 points (2 hearts) of damage

The bug

Wild wolves deal 4 points (2 hearts) of damage in Normal mode.

Expected result

Wild wolves should deal 2 points (1 heart) of damage. For every other mob in the game, this is the amount of damage done in Normal mode. (Some exceptions exist, such as hoglins randomized damage or mobs holding items, but they're all still based on this number.)

Code analysis

In the file Wolf.java, the wolf's damage is set to 2 (1 heart) with this code: add(Attributes.ATTACK_DAMAGE, 2.0).

Later in the code:

public void setTame(boolean bl) {
 super.setTame(bl);
 if (bl) {
 this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(20.0);
 this.setHealth(20.0f);
} else {
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(8.0);
}
this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(4.0);
 }

The bit that sets the tamed wolf's attack damage to 4 does not actually test if the wolf is tamed or not. This is most likely a bug as there's no reason to take all these extra steps.

Attachments

Comments 2

Can confirm in 1.19.3 and latest snapshot 23w04a; Relates to MC-71977 (and vice versa) as they are caused by the same mistake on the game's code. This is present in the game since 1.8 snapshot 14w26a

Can confirm in 24w10a.

PancakeIdentity

(Unassigned)

Confirmed

Mob behaviour

1.16.2, 1.16.5, 21w10a, 22w11a, 22w13a, 1.19.3, 23w04a

Retrieved