shootingEntity = $shootingEntity; parent::__construct($chunk, $nbt); } public function onUpdate($currentTick){ if($this->closed){ return false; } $this->timings->startTiming(); $hasUpdate = parent::onUpdate($currentTick); if($this->age > 1200 or $this->isCollided){ $this->kill(); $hasUpdate = true; } $this->timings->stopTiming(); return $hasUpdate; } public function spawnTo(Player $player){ $pk = new AddEntityPacket(); $pk->type = Snowball::NETWORK_ID; $pk->eid = $this->getId(); $pk->x = $this->x; $pk->y = $this->y; $pk->z = $this->z; $pk->did = 0; //TODO: send motion here $player->dataPacket($pk); $player->addEntityMotion($this->getId(), $this->motionX, $this->motionY, $this->motionZ); parent::spawnTo($player); } }