diff --git a/core/src/main/java/tc/oc/pgm/spawns/states/Observing.java b/core/src/main/java/tc/oc/pgm/spawns/states/Observing.java index 6873c973d0..e086be4c0e 100644 --- a/core/src/main/java/tc/oc/pgm/spawns/states/Observing.java +++ b/core/src/main/java/tc/oc/pgm/spawns/states/Observing.java @@ -137,8 +137,9 @@ public void onEvent(EntityDamageEvent event) { public void onEvent(InventoryClickEvent event) { super.onEvent(event); - if (!(event.getClickedInventory() instanceof PlayerInventory - || event.getClickedInventory().getType() == InventoryType.CRAFTING) + var inv = event.getInventory(); + if (inv == null + || !(inv instanceof PlayerInventory || inv.getType() == InventoryType.CRAFTING) || event.getCursor() == null) return; ItemStack item = event.getCursor();