What is the correct way to use setRecipients()? I have stored the players i want the chat to be sent to in an array. But arrays dont work. Player objects dont work either.
The array you are using for setRecipients() has to have the same format as the array returned in getRecipients(). The only parameter that will work for setRecipients() is an array.
It should be an array of player objects, just like what $level->getPlayers() and $server->getOnlinePlayers() return.
Using an array doesn't necessarily result in a crash. Using a string array does. https://github.com/PocketMine/Pocke...cketmine/event/player/PlayerChatEvent.php#L41 Isn't this quite obvious?