diff --git a/src/main/java/com/iridium/iridiumskyblock/listeners/PlayerInteractListener.java b/src/main/java/com/iridium/iridiumskyblock/listeners/PlayerInteractListener.java index f46679cbd..c72787b0d 100644 --- a/src/main/java/com/iridium/iridiumskyblock/listeners/PlayerInteractListener.java +++ b/src/main/java/com/iridium/iridiumskyblock/listeners/PlayerInteractListener.java @@ -38,6 +38,10 @@ public void onClick(PlayerInteractEvent event) { } } + // If the item in hand is not a bank item, but the player did not click a block, this returns null. + // Normally, this isn't an issue, but we're not ignoring cancelled events to allow crystals to be deposited. + if(event.getClickedBlock() == null) return; + Optional island = IridiumSkyblock.getInstance().getTeamManager().getTeamViaPlayerLocation(player, event.getClickedBlock().getLocation()); if (!island.isPresent()) return; if (!IridiumSkyblock.getInstance().getTeamManager().getTeamPermission(island.get(), user, PermissionType.BLOCK_BREAK)) {