From 1c0af0765e40007dce3d33f3adf3ce0cdd72b044 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Mon, 30 Sep 2019 12:34:51 -0600 Subject: [PATCH] Fix entity NPE because Spigot is great --- src/main/java/com/songoda/skyblock/listeners/Entity.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/songoda/skyblock/listeners/Entity.java b/src/main/java/com/songoda/skyblock/listeners/Entity.java index 0754f9ae..4967ae3c 100644 --- a/src/main/java/com/songoda/skyblock/listeners/Entity.java +++ b/src/main/java/com/songoda/skyblock/listeners/Entity.java @@ -291,6 +291,9 @@ public class Entity implements Listener { return; org.bukkit.entity.Entity target = event.getTarget(); + // Somehow the target can be null, thanks Spigot. + if (target == null) + return; IslandManager islandManager = skyblock.getIslandManager(); Island entityIsland = islandManager.getIslandAtLocation(entity.getLocation());