Hey PMMP devs, I would like to know how to set a lore on a item and check on PlayerInteractEvent if the player has that item with the lore.
These 2 functions. https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/item/Item.php#L481-#L508
This is the developer section. If you want code, you should ask in the facepalm section. Otherwise, make an attempt to understand it on your own before asking for code.
Yes I know it's the developer section... Other people do the same thing aswell. I actually didn't know, if you have a problem me not knowing it how would i know then?
No the problem is that you're just asking for code and not an explanation. You're just asking for us to give you the code without you trying to understand it.
if you want to add Lore if the Item doesn't have one use this code: PHP: /*** @param Item $item* @param array $lore* @return Item*/public function addLoreIfNotExist(Item $item, array $lore) : Item{ if($item->getLore() === []){ return $item->setLore($lore); } return $item;}