Why does the code dont send a message to the player, if the player clicked on the sign with the first line called [SHOP]? Sorry idk how to uplaod a file or someone else ^^ public function onInteract(PlayerInteractEvent $event){ if($event->getBlock()->getId() === Block::WALL_SIGN || $event->getBlock()->getId() === Block::SIGN_POST) { $tile = $event->getBlock()->getLevel()->getTile($event->getBlock()); if($tile instanceof \pocketmine\tile\Sign) { $line1 = $tile->getText()[0]; if($line1 === "[SHOP]") { $event->getPlayer()->sendMessage("Cool!"); } } } }
PHP: public function onTap(PlayerInteractEvent $ev) { $b = $ev->getBlock(); $p = $ev->getPlayer(); $tile = $b->getLevel()->getTile($b); if ($b->getId() === BlockIds::SIGN_POST || $b->getId() === BlockIds::WALL_SIGN) { if ($tile instanceof Sign){ if ($tile->getText()[0] === '[SHOP]'){ $p->sendMessage("Cool!"); } } } Works For me