The bug
Snow Golems are intended to simply push mobs back with snowballs, not deal damage to them. However, the snowballs they shoot will hurt and kill wolves, both tamed and wild.
Currently unknown if this affects any other mobs (other than blazes, but this works as intended), but this doesn't seem to be the case.
Steps to reproduce:
1. Snow Golems will never attack wolves, so you must place a wolf in it's line of sight while the golem is attacking a monster
2. Restrain the wolf as well, or the golem will die.
3. The snowballs will damage the wolf and, with consistent hits, it will die.
Note: It's easier to use tamed wolves in this situation as their tails are a visual indicator of their health.
Code analysis
Code analysis can be found in this comment.
Attachments
Comments 25
Code analysis
Based on yarn 1.18.2 mappings
public boolean damage(DamageSource source, float amount) {
// ...
if (entity != null && !(entity instanceof PlayerEntity) && !(entity instanceof PersistentProjectileEntity)) {
amount = (amount + 1.0F) / 2.0F;
}
// ...
}
This is the damage function of a wolf. As you can see, for damage values of zero, (0 + 1) / 2 = 0.5 damage. Another check should be added to check if the amount of damage is zero and not modify it.
He just accidently hits them while fighting the slime. Wolves become angry at whatever attacks them, so there's no bug here.