Use Server->getOnlinePlayers() to get all online players, then use array_rand to pick a random player. Then use Player->getInventory()->addItem() to give them the item.