If item has enchantments

Discussion in 'Plugin Development' started by javoris767, Jan 28, 2013.

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

    javoris767

    Hello, how do I tell if the item in a player's hand has an enchantment? I tried doing it, but it looks wrong XD

    Oops posted in the wrong section D:

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
  2. Offline

    CeramicTitan Retired Staff

    If(p.getItemInHand().containsEnchantment(Enchantment. FIRE_ASPECT){//do something If the item in hand has fire aspect}
     
  3. Offline

    Fadmad

    You can also use && for and and || for or in order to see for more than one enchantment, rather than using many if statements.
     
Thread Status:
Not open for further replies.

Share This Page