Universal Enchants

Universal Enchants

2M Downloads

[Bug]: Thorns is always enabled for Armor regardless of config

Dekamir opened this issue ยท 3 comments

commented

Mod Loader (Required)

Fabric

Minecraft Version (Required)

1.19.2

Mod Version (Required)

1.1.1

Notes (Required)

Thorns is applied to all Armor regardless of the configuration.
Even when Thorns is only set to $minecraft:armor_helmet or $minecraft:universal_enchants_shield, or both.

Additional items or tags can be used to add Thorns to them, such as Shields. This seem to work properly.

latest.log (Optional)

No response

commented

Thanks for the report!

This is caused by the way vanilla handles enchantment compatibilities in an anvil vs an enchanting table. Anvils use some manual overrides for certain enchantments, such as thorns on all armor and efficiency on shears, those unfortunately apply before the enchanting table compatibility check (which is where Universal Enchants hooks in) is fired.

This would probably be best solved by splitting the items array in enchantment configs in two: one for compatibilities in an enchanting table and the other one for anvils. Not sure though if it'll be implemented as it's a very niche case removing those few enchantments from items, after all the intend behind Universal Enchants is to go the other way around haha.

commented

Thanks for the reply!
But I'm not using an Anvil to enchant. I use an enchanting table.

I use Enchancement, which lists all available enchants to the player and allows selecting them one-by-one. Looks like only Thorns do this and no other enchantment else. I also tested this on clean/minimal environment just to test if another mod is interfering with enchantment groups.

commented

That's still the same issue basically.

In that case Enchancement though when checking enchantment compatibility seems to be using the anvil check (Enchantment::canApply) and not the enchantment table check (EnchantmentCategory::canEnchant).
You maybe could ask if this is intentional on their end.