Item.opBinaryRight

Adds an enchantment to the item.

  1. void opBinaryRight(Enchantment ench)
    class Item
    @safe
    void
    opBinaryRight
    (
    string op : "+"
    )
  2. Enchantment* opBinaryRight(sul.enchantments.Enchantment ench)
  3. void opBinaryRight(sul.enchantments.Enchantment ench)

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