How to check amount UnsafeEnchantment?

Discussion in 'Plugin Development' started by makcoh2018, Jul 19, 2021.

Thread Status:
Not open for further replies.
  1. Offline

    makcoh2018

    Hey. I maked custom enchantments and i need to make check on amount unsafeenchantment on the item and if amount =2 send message. How to make this check?
     
  2. Offline

    pixelrider2000

    Could you please put your issue in an understandable sentence or in other words; may you elaborate on your problem?
     
  3. Offline

    Strahan

    Well, like pixelrider I'm a little confused as to what you are asking. But if you are trying to check if someone is attempting to enchant an item with your custom enchant at what would be an out of bounds level (unsafe), it depends how you implemented your custom enchant. I assume you have some sort of object for it, right? If so, add a max level int and make a method getMaxLevel() then you can call that to validate, just like the built in Enchantment class. If your custom enchant is just a matter of checking item "fingerprint" at interact and performing actions, then you need to just base your check on whatever enchant they are attempting to use and build logic into the enchanting command.

    If that's not what you mean, explain with more detail.
     
Thread Status:
Not open for further replies.

Share This Page