Beispiel #1
0
 public function spawnTo(Player $player)
 {
     $pk = new AddEntityPacket();
     $pk->eid = $this->getId();
     $pk->type = Skeleton::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->dataProperties;
     $player->dataPacket($pk);
     $player->addEntityMotion($this->getId(), $this->motionX, $this->motionY, $this->motionZ);
     parent::spawnTo($player);
 }
Beispiel #2
0
 public function spawnTo(Player $player)
 {
     $pk = new AddEntityPacket();
     $pk->eid = $this->getId();
     $pk->type = Enderman::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);
 }
Beispiel #3
0
 public function spawnTo(Player $player)
 {
     $pk = new AddEntityPacket();
     $pk->eid = $this->getId();
     $pk->type = self::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->setChannel(Network::CHANNEL_ENTITY_SPAWNING));
     parent::spawnTo($player);
 }
 public function spawnTo(Player $player)
 {
     $pk = new AddEntityPacket();
     $pk->eid = $this->getId();
     $pk->type = self::NETWORK_ID;
     $pk->x = $this->x;
     $pk->y = $this->y;
     $pk->z = $this->z;
     $pk->speedX = $this->motionX;
     $pk->speedY = 1.5;
     $pk->speedZ = $this->motionZ;
     $pk->yaw = $this->yaw;
     $pk->pitch = $this->pitch;
     $pk->metadata = [Entity::DATA_NAMETAG => [Entity::DATA_TYPE_STRING, $this->getDataProperty(2)], Entity::DATA_SHOW_NAMETAG => [Entity::DATA_TYPE_BYTE, 1], Entity::DATA_NO_AI => [Entity::DATA_TYPE_BYTE, 1]];
     $player->dataPacket($pk->setChannel(Network::CHANNEL_ENTITY_SPAWNING));
     parent::spawnTo($player);
 }
Beispiel #5
0
 public function knockBack(Entity $attacker, $damage, $x, $z, $base = 2)
 {
     echo __METHOD__ . "," . __LINE__ . "\n";
     //##DEBUG
     parent::knockBack($attacker, $damage, $x, $z, $base);
     $this->knockback = time() + 1;
     // Stunned for 1 second...
 }