From 57132d3e1e497f907f47d1fe927a90826c31e56c Mon Sep 17 00:00:00 2001 From: meyason Date: Mon, 7 Oct 2024 00:17:13 +0900 Subject: [PATCH] fix playerHit error --- .../subplugins/universeguns/event/GunEvent.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/space/yurisi/universecorev2/subplugins/universeguns/event/GunEvent.java b/src/main/java/space/yurisi/universecorev2/subplugins/universeguns/event/GunEvent.java index 3dcad5b2..9a92a918 100644 --- a/src/main/java/space/yurisi/universecorev2/subplugins/universeguns/event/GunEvent.java +++ b/src/main/java/space/yurisi/universecorev2/subplugins/universeguns/event/GunEvent.java @@ -218,7 +218,9 @@ public void onPlayerHit(EntityDamageByEntityEvent event) { if (event.getEntity().isDead()) { return; } - LivingEntity livingEntity = (LivingEntity) event.getEntity(); + if (!(entity instanceof LivingEntity livingEntity)) { + return; + } if (event.getDamager() instanceof Snowball snowball) { if (!projectileData.containsKey(snowball)) { return;