-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Closed as not planned
Labels
resolution: works as intendedWorking as it should / expected toWorking as it should / expected to
Description
Expected behavior
The Enchantment method canEnchant() should take into account the enchantment's exclusive_set. For example, calling the method on Blast Protection with a piece of armor that already has Fire Protection should return false.
In this example, the Iron Leggings should only get Fire Protection.
ItemStack armorItem = new ItemStack(Material.IRON_LEGGINGS);
armorItem.addEnchantment(Enchantment.FIRE_PROTECTION, 1);
if (Enchantment.BLAST_PROTECTION.canEnchantItem(armorItem)) {
armorItem.addEnchantment(Enchantment.BLAST_PROTECTION, 1);
}Observed/Actual behavior
canEnchant() allows true in the example, which means we get Iron Leggings with both Fire Protection and Blast Protection.
Steps/models to reproduce
Test example provided, run a Paper server with the plugin and the datapack, holding a Dirt block triggers the example code.
Plugin and Datapack List
See "Steps to reproduce"
Paper version
1.21.11
Other
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
resolution: works as intendedWorking as it should / expected toWorking as it should / expected to