From 2953ea951321069a43b5b9195f960654b477ed73 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Mon, 6 Dec 2021 15:06:53 -0500 Subject: [PATCH] Fix NPE when hovering over ender dragon --- .../org/geysermc/geyser/entity/InteractiveTagManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/geysermc/geyser/entity/InteractiveTagManager.java b/core/src/main/java/org/geysermc/geyser/entity/InteractiveTagManager.java index fe423dde5..f8e1f43aa 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/InteractiveTagManager.java +++ b/core/src/main/java/org/geysermc/geyser/entity/InteractiveTagManager.java @@ -66,6 +66,10 @@ public class InteractiveTagManager { ItemMapping mapping = session.getPlayerInventory().getItemInHand().getMapping(session); String javaIdentifierStripped = mapping.getJavaIdentifier().replace("minecraft:", ""); EntityType entityType = interactEntity.getDefinition().entityType(); + if (entityType == null) { + // Likely a technical entity; we don't need to worry about this + return; + } InteractiveTag interactiveTag = InteractiveTag.NONE; @@ -90,7 +94,7 @@ public class InteractiveTagManager { // This animal can be fed interactiveTag = InteractiveTag.FEED; } else { - switch (interactEntity.getDefinition().entityType()) { + switch (entityType) { case BOAT: if (interactEntity.getPassengers().size() < 2) { interactiveTag = InteractiveTag.BOARD_BOAT;