GC-spigot / AdvancedEnchantments

Superior Custom Enchantments Creator for Minecraft And Spigot platform
138 stars 61 forks source link

[API Help] Getting required, removed, and incompatible enchants #4334

Closed Leomelonseeds closed 1 month ago

Leomelonseeds commented 1 month ago

Describe the bug

Hello, I was wondering if it is possible to access information about an enchant's required-enchants, removed-enchants, and not-applyable-with data from the API?

I understand there is not a specific method for this. But do any of the applyEnchant methods have fields that take these parameters into account? For example, could I test if two enchants were incompatible by using applyEnchant on an item that had one such incompatible enchant, and checking if the resulting item did not change?

Thank you for your time.

How to reproduce

N/A

Screenshots / Videos

No response

"/ae plinfo" link

https://paste.md-5.net/paruhosavo

Server Log

No response

ThomasWega commented 1 month ago

You can use the getEnchantmentInstance from AEAPI class and then on the instance you have getRequiredEnchants, getRemovedEnchants, getBlacklistedEnchants