help with Lore

Discussion in 'Development' started by Azonuno, Oct 15, 2021.

  1. Azonuno

    Azonuno Spider

    Messages:
    12
    public function onTouch(PlayerInteractEvent $event){
    $player = $event->getPlayer();
    $item = $event->getItem();

    $tile = $event->getPlayer()->getLevel()->getTile($event->getBlock());
    if($tile instanceof \pocketmine\tile\Sign){
    if($tile->getText()[0] === "poison"){
    $player->getInventory()->getItemInHand();
    if ($item->getId() == 352){
    $item->setLore(["Poison"]);
    $player->sendMessage("Item Enchanted");
    }else{
    $player->sendMessage("[SkyDungeons] You Can't Enchant this item");
    }

    everything works but setlore????
     
  2. minijaham

    minijaham Zombie Pigman

    Messages:
    749
    GitHub:
    minijaham
    You have to give the item to player after setting lore
     

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.