diff --git a/src/main/java/net/coreprotect/listener/entity/EntityDeathListener.java b/src/main/java/net/coreprotect/listener/entity/EntityDeathListener.java index 8a9ac74..0883812 100644 --- a/src/main/java/net/coreprotect/listener/entity/EntityDeathListener.java +++ b/src/main/java/net/coreprotect/listener/entity/EntityDeathListener.java @@ -289,7 +289,7 @@ public final class EntityDeathListener extends Queue implements Listener { if (attributeInstance != null) { List attributeData = new ArrayList<>(); List attributeModifiers = new ArrayList<>(); - attributeData.add(attributeInstance.getAttribute()); + attributeData.add(BukkitAdapter.ADAPTER.getRegistryKey(attributeInstance.getAttribute())); attributeData.add(attributeInstance.getBaseValue()); for (AttributeModifier modifier : attributeInstance.getModifiers()) { diff --git a/src/main/java/net/coreprotect/utility/entity/EntityUtil.java b/src/main/java/net/coreprotect/utility/entity/EntityUtil.java index 98f8fe7..8d7b886 100644 --- a/src/main/java/net/coreprotect/utility/entity/EntityUtil.java +++ b/src/main/java/net/coreprotect/utility/entity/EntityUtil.java @@ -166,7 +166,13 @@ public class EntityUtil { for (Object value : attributes) { @SuppressWarnings("unchecked") List attributeData = (List) value; - Attribute attribute = (Attribute) attributeData.get(0); + Attribute attribute = null; + if (attributeData.get(0) instanceof Attribute) { + attribute = (Attribute) attributeData.get(0); + } + else { + attribute = (Attribute) BukkitAdapter.ADAPTER.getRegistryValue((String) attributeData.get(0), Attribute.class); + } Double baseValue = (Double) attributeData.get(1); @SuppressWarnings("unchecked") List attributeModifiers = (List) attributeData.get(2);