本文整理匯總了PHP中Monster::spawnTo方法的典型用法代碼示例。如果您正苦於以下問題:PHP Monster::spawnTo方法的具體用法?PHP Monster::spawnTo怎麽用?PHP Monster::spawnTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Monster
的用法示例。
在下文中一共展示了Monster::spawnTo方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: spawnTo
public function spawnTo(Player $player)
{
$pk = $this->addEntityDataPacket($player);
$pk->type = Creeper::NETWORK_ID;
$player->dataPacket($pk);
parent::spawnTo($player);
}
示例2: spawnTo
public function spawnTo(Player $player)
{
$pk = new AddMobPacket();
$pk->eid = $this->getId();
$pk->type = Zombie::NETWORK_ID;
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;
$pk->yaw = $this->yaw;
$pk->pitch = $this->pitch;
$pk->metadata = $this->getData();
$player->dataPacket($pk);
$player->addEntityMotion($this->getId(), $this->motionX, $this->motionY, $this->motionZ);
parent::spawnTo($player);
}
示例3: spawnTo
public function spawnTo(Player $player)
{
$pk = new AddEntityPacket();
$pk->eid = $this->getId();
$pk->type = Zombie::NETWORK_ID;
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;
$pk->speedX = $this->motionX;
$pk->speedY = $this->motionY;
$pk->speedZ = $this->motionZ;
$pk->yaw = $this->yaw;
$pk->pitch = $this->pitch;
$pk->metadata = $this->dataProperties;
$player->dataPacket($pk);
parent::spawnTo($player);
}
示例4: spawnTo
public function spawnTo(Player $player)
{
$pk = new AddEntityPacket();
$pk->eid = $this->getId();
$pk->type = Blaze::NETWORK_ID;
$pk->x = $this->x;
$pk->y = $this->y + 2;
$pk->z = $this->z;
$pk->speedX = $this->motionX;
$pk->speedY = $this->motionY;
$pk->speedZ = $this->motionZ;
$pk->yaw = $this->yaw;
$pk->pitch = $this->pitch;
$pk->metadata = $this->dataProperties;
$player->dataPacket($pk->setChannel(Network::CHANNEL_ENTITY_SPAWNING));
$player->addEntityMotion($this->getId(), $this->motionX, $this->motionY, $this->motionZ);
parent::spawnTo($player);
}
示例5: spawnTo
public function spawnTo(Player $player)
{
$pk = new AddEntityPacket();
$pk->eid = $this->getId();
$pk->type = PigZombie::NETWORK_ID;
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;
$pk->speedX = $this->motionX;
$pk->speedY = $this->motionY;
$pk->speedZ = $this->motionZ;
$pk->yaw = $this->yaw;
$pk->pitch = $this->pitch;
$pk->metadata = $this->dataProperties;
$player->dataPacket($pk);
parent::spawnTo($player);
$pk = new MobEquipmentPacket();
$pk->eid = $this->getId();
$pk->item = new ItemItem(283);
$pk->slot = 0;
$pk->selectedSlot = 0;
$player->dataPacket($pk);
}