Getting enchantment

Discussion in 'Plugin Development' started by Faith, Mar 23, 2015.

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

    Faith

    How do I get enchantment and level of an item? I need to find Looting 2 and Looting 3.

    Also, does anyone know the default EXP for killing a player?
     
  2. Offline

    valon750

    @Faith

    You'll want to establish a HashMap<Enchantment, Integer>, casting it to item.getEnchantments();

    As for the default EXP of killing a player, I don't believe there is anything, unless of course the player themselves have levels at the time. Of course the amount dropped is only a fragment of their original amount.

    Hope this helped :)
     
  3. Offline

    Faith

    @valon750 I am trying to double the EXp for Looting 2 sword and triple the EXP gained for Looting 3.
     
  4. Offline

    valon750

    @Faith

    Alright then, so you'll likely need to listen for the PlayerDeathEvent, get the amount of XP dropped, then alter it based off the enchantments level.
     
  5. @Faith
    item.getItemMeta().getEnchantLevel(Enchantment.LOOT_BONUS_MOBS);
     
Thread Status:
Not open for further replies.

Share This Page