diff --git a/src/main/java/de/teamlapen/vampirism/entity/player/vampire/actions/InfectAction.java b/src/main/java/de/teamlapen/vampirism/entity/player/vampire/actions/InfectAction.java index 2203622b8..3434365cd 100644 --- a/src/main/java/de/teamlapen/vampirism/entity/player/vampire/actions/InfectAction.java +++ b/src/main/java/de/teamlapen/vampirism/entity/player/vampire/actions/InfectAction.java @@ -62,8 +62,8 @@ public IActionResult canBeUsedBy(@NotNull IVampirePlayer player) { } if (player.isRemote()) { Entity target = VampirismMod.proxy.getMouseOverEntity(); - if (target != null) { - if (UtilLib.canReallySee((LivingEntity) target, player.asEntity(), false)) { + if (target instanceof LivingEntity living) { + if (UtilLib.canReallySee(living, player.asEntity(), false)) { return IActionResult.fail(Component.translatable("text.vampirism.action.infect.sees_you")); } if(!deriveBiteableEntry(target).map(b -> b.canBeInfected(player)).orElse(false)) {