1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Enchanting Command

Discussion in 'Development' started by Baducai, Oct 14, 2017.

  1. Baducai

    Baducai Spider Jockey

    Messages:
    30
    GitHub:
    Baducai
    How do I adde an enchantment on an item where I have in hand with a custom command?
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    In your onCommand function:
    PHP:
    $sender->getInventory()->getItemInHand()->addEnchantment(Enchantment::getEnchantment(Enchantment::SPEED));
     
  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.