Item.opBinaryRight

Adds an enchantment to the item.

Throws

EnchantmentException if the enchantment doesn't exist

Examples

item.addEnchantment(new Enchantment(Enchantments.sharpness, 1));
item.addEnchantment(Enchantments.power, 5);
item.addEnchantment(Enchantments.fortune, "X");
item += new Enchantment(Enchantments.smite, 2);

Meta