Separate names with a comma.
Comments in 'Plugin Development' started by Ilikemining1, Mar 27, 2015.
How would you print text to chat with pocketmine api?
For a Player object: $player->sendMessage($msg);
For all players in a Server object: $this->getServer()->broadcastMessage($msg);
And to get the object use: $event->getPlayer()
If it's the $sender it's already the player object.
No, $sender may be other types such as ConsoleCommandSender. There may be other command sender classes too, such as those from plugins. And not everyone calls it $sender.
$event->getPlayer() is only the doer of the event.
Thank You that worked, I'm very new to php and pocketmine coding so thank you for being helpful.