Check if this item can be enchanted.

Discussion in 'Plugin Development' started by Protophite, Feb 15, 2014.

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

    Protophite

    Lets say I have a config file:

    items:
    - DIAMOND_SWORD:1:DAMAGE_ALL:5
    - BREAD:16

    how can I check if (BREAD) can be enchanted?
     
  2. Offline

    Evoke

  3. Offline

    minecraft124_

  4. Offline

    Protophite

  5. Offline

    minecraft124_

    Code:java
    1.  
    2. ItemStack itemStack = new ItemStack(Material.STONE,1);
    3. Enchantment enchantment = Enchantment.ARROW_DAMAGE;
    4. if(enchantment.canEnchantItem(itemStack)) {
    5.  
    6. } else {
    7.  
    8. }
     
  6. Offline

    Protophite

Thread Status:
Not open for further replies.

Share This Page