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??
You will need to put the newly enchanted item in the player's hand: PHP: $player->getInventory()->setItemInHand($item);