Only target living entities for the homing spells

This commit is contained in:
Sollace 2023-08-27 23:39:13 +01:00
parent a6cb13e27a
commit fbf96005ae
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -110,7 +110,7 @@ public class UnicornCastingAbility extends AbstractSpellCastingAbility {
} else {
player.setAnimation(Animation.ARMS_UP, Animation.Recipient.HUMAN);
if (s instanceof HomingSpell homer) {
TraceHelper.findEntity(player.asEntity(), homer.getRange(player), 1, EntityPredicates.VALID_ENTITY).ifPresent(homer::setTarget);
TraceHelper.findEntity(player.asEntity(), homer.getRange(player), 1, EntityPredicates.VALID_LIVING_ENTITY).ifPresent(homer::setTarget);
}
player.playSound(USounds.SPELL_CAST_SUCCESS, 0.05F, 2.2F);
}