pocketmine\entity\Entity::spawnTo PHP Method

spawnTo() public method

public spawnTo ( Player $player )
$player pocketmine\Player
    public function spawnTo(Player $player)
    {
        if (!isset($this->hasSpawned[$player->getLoaderId()]) and isset($player->usedChunks[Level::chunkHash($this->chunk->getX(), $this->chunk->getZ())])) {
            $this->hasSpawned[$player->getLoaderId()] = $player;
        }
    }

Usage Example

Example #1
0
 public function spawnTo(Player $player)
 {
     $pk = $this->addEntityDataPacket($player);
     $pk->type = self::NETWORK_ID;
     $player->dataPacket($pk);
     parent::spawnTo($player);
 }
All Usage Examples Of pocketmine\entity\Entity::spawnTo