diff --git a/paper-server/src/main/java/io/papermc/paper/attribute/UnmodifiableAttributeInstance.java b/paper-server/src/main/java/io/papermc/paper/attribute/UnmodifiableAttributeInstance.java index 12135ffeac..52439f4b95 100644 --- a/paper-server/src/main/java/io/papermc/paper/attribute/UnmodifiableAttributeInstance.java +++ b/paper-server/src/main/java/io/papermc/paper/attribute/UnmodifiableAttributeInstance.java @@ -23,6 +23,11 @@ public class UnmodifiableAttributeInstance extends CraftAttributeInstance { throw new UnsupportedOperationException("Cannot modify default attributes"); } + @Override + public void addTransientModifier(AttributeModifier modifier) { + throw new UnsupportedOperationException("Cannot modify default attributes"); + } + @Override public void removeModifier(AttributeModifier modifier) { throw new UnsupportedOperationException("Cannot modify default attributes"); diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java b/paper-server/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java index 3b171a08bd..cd6a492f56 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java @@ -51,6 +51,14 @@ public class CraftAttributeInstance implements AttributeInstance { this.handle.addPermanentModifier(CraftAttributeInstance.convert(modifier)); } + // Paper start - Transient modifier API + @Override + public void addTransientModifier(AttributeModifier modifier) { + Preconditions.checkArgument(modifier != null, "modifier"); + this.handle.addTransientModifier(CraftAttributeInstance.convert(modifier)); + } + // Paper end + @Override public void removeModifier(AttributeModifier modifier) { Preconditions.checkArgument(modifier != null, "modifier");