Hello! I was just wondering if it's possible in mcpe to have his plugin made. Basically this plugin could work with purechat. When a player types someone else's name into chat it will appear in a different colour text to that player (to get there attention) and maybe make a sound when there name is sent into the chat window. It's a nice feature to have if, for example you hide your chat the little sound would notify you that your name had been entered! That's all.. sorry if it's not possible. - MC ATECH
look at the plugin mention by falk just regexr the text i suppose but regexing the whole centense may cause not so great lag issues so regex it in a thread! late notify better then no notify for like a bold on your name, you may need to broadcast it to everyone other then the one begin mention and highlight the name then sent it to the mentioned one
Oh, like a notification. But I don't think it's possible to get the colour of the word before the player's name. Players[ "Jimmy", "Timmy" ] Message: "Hey jimmy, long time no see!" There is no way (alright, there might be some way but it's probably hard) to get the colour of the word before Jimmy (i.e "Hey"), so I guess "it will appear in a different colour text to that player" won't be possible. (For the sake of the argument, even if you assume that PureChat's API makes it possible to detect the message format, this will still be a problem for players customizing their chat with TextFormat::ESCAPE codes; "§eHi jimmy §a;D"). Spoiler: Just a tip for anyone trying to code this plugin Do NOT: PHP: /** @var Server $server *//** @var string $message */$message = implode(" ", $message);foreach($message as &$word){ if(($player = $server->getPlayerExact($word)) !== null){ $word = $player->getName(); }} You are creating two loops. Server::getPlayerExact() calls for a loop. R.I.P TPS for servers having many players.
Here it is: Not tested. I'm not familiar with sounds, and I don't want to do the boring work of converting strings to sound classes, so it's hardcoded as PopSound(pitch=0).