How to add Enchant

Discussion in 'Development' started by rhod600, Jun 17, 2019.

  1. rhod600

    rhod600 Creeper

    Messages:
    2
    How to add Enchant
    API: 3.0.0
     
  2. HimbeersaftLP

    HimbeersaftLP Chicken

    Messages:
    1,585
    GitHub:
    HimbeersaftLP
  3. Emirhan Akpınar

    Emirhan Akpınar Witch

    Messages:
    58
    GitHub:
    EmirhanWSD
    PHP:
    /** @var Item $item */
    $item->addEnchantment(new EnchantmentInstance(Enchantment::getEnchantment(id), level));
     
  4. rhod600

    rhod600 Creeper

    Messages:
    2
    you can not add several, only one
     
  5. KielKing

    KielKing Zombie

    Messages:
    254
    GitHub:
    kielking
    yes you can, just call the addEnchantment function again with your other enchantment
     
    jasonwynn10 and HimbeersaftLP like this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.