Bro... Really? Anyways If you mean like on an event like PlayerJoinEvent() do PHP: onJoin(PlayerJoinEvent $event){$player = $event->getPlayer();//Gets the player you want to send item too.$item = $player->getItem();//Actual giving the player something$player->getInventory()->addItem(Item::GOLDEN_APPLE);//Gives the item.//GIVES THE PLAYER THE ITEM WHEN THEY JOIN.
PHP: /** * @var Item $item */$players = ["person1", "player2", "user3", "blablabla"];foreach($players as $player) { $player = $this->getServer()->getPlayer($player); if($player) { // checks if player is online, returns NULL (= false) if player not online/not found $player->getInventory()->addItem($item); }}
seriously... If you don't bother to look at PocketMine's API before asking this, post in the facepalm section