Get Enchantment that was added on EnchantItemEvent

Discussion in 'Plugin Development' started by Wbjpen, Nov 14, 2013.

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

    Wbjpen

    In EnchantItemEvent, there's a method called getEnchantsToAdd(). I want to get the enchantment that was just added to the item and check if it contains a certain enchantment, I've tried a few things but none of them seem to work.
     
  2. Offline

    felixfritz

    Does it work, if you get the item from that event and check, what enchantments it has?
     
  3. Offline

    Wbjpen

    It doesn't. I just tried this:
    Code:
            ItemStack i = e.getItem();
            if(i.getEnchantments().containsKey(Enchantment.DAMAGE_ARTHROPODS)){
     
  4. Offline

    L33m4n123

    if I understand the API correct, you need to use in the Event getEnchantsToAdd
     
Thread Status:
Not open for further replies.

Share This Page