diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Soulbound.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Soulbound.java index a5dfbec3..a29fc2c8 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Soulbound.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Soulbound.java @@ -75,6 +75,14 @@ public class Soulbound extends EcoEnchant { assert meta != null; PersistentDataContainer container = meta.getPersistentDataContainer(); container.set(this.getPlugin().getNamespacedKeyFactory().create("soulbound"), PersistentDataType.INTEGER, 1); + + if (this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "remove-after")) { + if (meta instanceof EnchantmentStorageMeta) { + ((EnchantmentStorageMeta) meta).removeStoredEnchant(this); + } + meta.removeEnchant(this); + } + itemStack.setItemMeta(meta); } diff --git a/eco-core/core-plugin/src/main/resources/enchants/special/soulbound.yml b/eco-core/core-plugin/src/main/resources/enchants/special/soulbound.yml index b57e1655..9335c0cf 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/special/soulbound.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/special/soulbound.yml @@ -20,4 +20,4 @@ general-config: conflicts: [] config: - # No config is available for this enchantment \ No newline at end of file + remove-after: false # If soulbound should be 1-time use \ No newline at end of file