Enchantment not Working

Discussion in 'Development' started by QuiverlyRivalry, Mar 23, 2020.

  1. QuiverlyRivalry

    QuiverlyRivalry Zombie Pigman

    Messages:
    493
    GitHub:
    quiverlyrivalry
    My code: https://hasteb.in/asadotuj.php
    Problem: For some reason it skips the whole add enchantment and then execute the sendMessage test. Check the video the code above shows that when it’s run it adds enchant and sends message test, but in the video it doesn’t add anything but still sends message??

     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,091
    GitHub:
    HimbeersaftLP
    You will need to put the newly enchanted item in the player's hand:
    PHP:
    $player->getInventory()->setItemInHand($item);
     
    GamakCZ and QuiverlyRivalry like this.
  3. QuiverlyRivalry

    QuiverlyRivalry Zombie Pigman

    Messages:
    493
    GitHub:
    quiverlyrivalry
    It works. Thanks so much :DDD!
     
    HimbeersaftLP likes this.
  4. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,091
    GitHub:
    HimbeersaftLP
    No problem! Your plugin looks very cool so far!
     

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.