From d40b279680bf2cd380bb260894e496331bc5b6f1 Mon Sep 17 00:00:00 2001 From: Me <135455255+IcarussOne@users.noreply.github.com> Date: Fri, 9 Aug 2024 08:23:12 -0500 Subject: [PATCH] Add a forgotten check --- src/main/java/mod/emt/balkonsexpansion/event/BEEvents.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/mod/emt/balkonsexpansion/event/BEEvents.java b/src/main/java/mod/emt/balkonsexpansion/event/BEEvents.java index 15a8b81..061f36f 100644 --- a/src/main/java/mod/emt/balkonsexpansion/event/BEEvents.java +++ b/src/main/java/mod/emt/balkonsexpansion/event/BEEvents.java @@ -30,6 +30,10 @@ public static void onBlockMelee(LivingAttackEvent event) { if (!source.isUnblockable() && player.isActiveItemStackBlocking()) { ItemStack stack = player.getActiveItemStack(); Item item = stack.getItem(); + + // Skips unwanted items and null values to prevent crashes. + if (!(item instanceof IItemWeapon)) return; + MeleeComponent meleeComp = ((IItemWeapon) stack.getItem()).getMeleeComponent(); // Additional blocking sound for battleaxes and katanas.