From 212726b34667f13be8437b38c9dc96dd1b625fbe Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Tue, 17 Sep 2024 12:53:51 -0700 Subject: [PATCH] chore: null check --- .../thebusybiscuit/extraheads/listeners/HeadListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/extraheads/listeners/HeadListener.java b/src/main/java/io/github/thebusybiscuit/extraheads/listeners/HeadListener.java index 67eb2a5..57065c5 100644 --- a/src/main/java/io/github/thebusybiscuit/extraheads/listeners/HeadListener.java +++ b/src/main/java/io/github/thebusybiscuit/extraheads/listeners/HeadListener.java @@ -49,7 +49,7 @@ private double getChance(@Nonnull EntityType type, @Nullable Player killer) { ItemStack item = killer.getInventory().getItemInMainHand(); SwordOfBeheading sword = (SwordOfBeheading) SlimefunItems.SWORD_OF_BEHEADING.getItem(); - if (item.isEmpty() || !sword.isItem(item) || sword.isDisabledIn(killer.getWorld())) { + if (item.isEmpty() || sword == null || !sword.isItem(item) || sword.isDisabledIn(killer.getWorld())) { return chance; }