hey that's suppose to be my line! how are you expecting us to know what you even want, please show some examples of what you meant i cant read minds
If you're making a plugin that sends broadcast messages: PHP: $sender->getServer()->broadcastMessage("Your Message here"); If you are making a plugin that adds a broadcast command: PHP: public $plugin_prefix = "§7[§a§lBroadcast§r§7]§f ";public $error_prefix = "§7[§c§lBroadcast§r§7] ";public $broadcast_message_prefix = "§7[§a§lMyServer§r§7]§f";public function onCommand(CommandSender $sender, Command $command, array $args) { if($command->getName() === "broadcast") { if(isset($args[0]) { $message = implode(" ", $args); $sender->getServer()->broadcastMessage($broadcast_message_prefix . $message); } else { $sender->sendMessage($error_prefix . "§cYou cannot send an empty message!"); } }} If you're looking for a plugin that does Broadcast Messages on your Server: https://github.com/EvolSoft/Broadcaster
You can do PHP: foreach($this->getServer()->getOnlinePlayers() as $p){ $p->sendMessage("Whatever you need to say...");}
fun fact they actually used the same code, just a bit abstracted so developers like us dont need to have the same thing in each of our plugins
i dont think that's true by code base they still uses the foreaches like what we would do... or at least any noticeable improvements
Definitely not. There is an extra method call, an also has to check permissions. If you want to send message to all players, not just players with the pocketmine.broadcast.user permission, don't use it.