From 335fec20368bf404d5b4a07f4b543345d97509b0 Mon Sep 17 00:00:00 2001 From: Sage Kummer Date: Fri, 25 Sep 2026 17:10:27 -0400 Subject: [PATCH] Skip a null tamed owner name when restoring an entity (#1012) A tamed animal whose owner has no known name is stored with a null owner, and restoring it throws a NullPointerException at the owner step, which drops the rest of the restore. A null owner name is now skipped like an empty one. --- src/main/java/net/coreprotect/utility/entity/EntityUtil.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/coreprotect/utility/entity/EntityUtil.java b/src/main/java/net/coreprotect/utility/entity/EntityUtil.java index 78e2a3c6..614967f8 100644 --- a/src/main/java/net/coreprotect/utility/entity/EntityUtil.java +++ b/src/main/java/net/coreprotect/utility/entity/EntityUtil.java @@ -195,7 +195,8 @@ public class EntityUtil { } else if (count == 1) { String set = (String) value; - if (set.length() > 0) { + // An owner whose name the server never learned was stored as null + if (set != null && set.length() > 0) { Player owner = Bukkit.getServer().getPlayer(set); if (owner == null) { OfflinePlayer offlinePlayer = Bukkit.getServer().getOfflinePlayer(set);