Hello I wanted to know how can I do that if the first line is written [hello] is the player presses it should something happen I would also like to know whether we wrote [hello] in the first line in the second to write something else
PHP: public function onSignClick(PlayerInteractEvent $event){$player = $event->getPlayer();$sign = $player->getLevel()->getTile($event-getBlock());if($event->getBlock()->getId() == 323 || $event->getBlock()->getId() == 63 || $event->getBlock()->getId() == 68){ //Sign on wall, ground or Itemif($sign instanceof Sign){$text = $sign->getText(); // Text on the Signif($text[0] == "[Hello]"){ //Text[0] = 1st Line, if the text on it is [Hello]$player->sendMessage("Hey!");}}}} Written on Phone, sorry for bad looking code!
A block ID would never be an item ID. Also, it is faster to confirm it is a sign before trying to get the tile.
But if I would do that if the line we wrote [TURFWARS] then the second line there will have to be written to the online player online from another server as I do
If you wanna know how get the Players of another Server, have a look at this post. To update the Sign, may use a Task.