Hello all, How can we set a message like this that will be displayed on the user's launcher? Is this possible to do with onPlayerJoin() ?
Yeah something like that, since I'm working on connecting multiple servers together, I cannot use the default ban system. Therefor, everytime an user joins, an API-request will be made. If it returns the user is banned, I need to kick him/her with this message.
Player::kick(string: $message, book: $isAdmin) PHP: /** @var $player pocketmine\Player */$player->kick(pocketmine\utils\TextFormat::GREEN . "Server restarted.", false);
Make sure to use double quotes for like break (\n) in PHP or if you wish use the PHP_EOL constant instead.
The PHP_EOL is a PHP (obviously lol) predefined constant that varies per platform (operating system), meaning it will not always be equal to \n (the Linux 'End Of Line' symbol). Reference: http://php.net/manual/en/reserved.constants.php
Where did I say it only works on a specific platform? I merely stated that its value varies across operating systems and it should not be used for sending messages (or any other text) to players. Good thing we're not talking about the command line
Oops, I didn't get you at first. I believe it's just the same for every Minecraft client and you're right PHP_EOL might not be the same as the Minecraft break line.