mojira.dev
MC-312728

Mace smash attack won't knock back mobs tamed by target

The mace smash attack does not knock back mobs like cats, wolves, etc. that are tamed by the player that gets hit.

Code analysis for 26.3, in MaceItem#knockbackPredicate, perhaps entity should be replaced with attacker here?

boolean notTamedByPlayer = !(
    nearby instanceof TamableAnimal animal && __entity__ instanceof LivingEntity livingAttacker && animal.isTame() && animal.isOwnedBy(livingAttacker)
);

Possibly caused by an oversight as a fix for MC-270791, worth noting that mobs tamed by the attacker are still not knocked back because of the line above:

boolean notAlliedToPlayer = !attacker.isAlliedTo(nearby);

so the notTamedByPlayer check is essentially redundant.

Comments 0

No comments.

RoccoDev

(Unassigned)

Unconfirmed

26.3

Retrieved