Enchantment conflicts and targets

Discussion in 'Bukkit Preview' started by Celtic Minstrel, Mar 14, 2012.

  1. Offline

    Celtic Minstrel

    There are two methods in the Enchantment API:
    1. Enchantment.conflictsWith(Enchantment), which will check if two enchantments are not permitted on the same item according to the enchantment tables. These restrictions are not checked by canEnchantItem(); if you wish to enforce them, you need to check manually.
    2. EnchantmentTarget.includes(Material|ItemStack), which will check if the given material matches the enchantment target.
    Note: Hoes, shears, fishing rods, and flint & steel are considered to be included in EnchantmentTarget.TOOL.
     
    mushroomhostage and Senators24 like this.

Share This Page