Hi guys. How to remove fall down of entity? PHP: <?phpdeclare(strict_types=1);namespace test;use pocketmine\entity\Creature;use pocketmine\network\mcpe\protocol\AddEntityPacket;use pocketmine\Player;class Firework extends Creature{ const NETWORK_ID = 72; public function spawnTo(Player $player) { $pk = new AddEntityPacket(); $pk->entityRuntimeId = $this->getId(); $pk->type = self::NETWORK_ID; $pk->position = $this->asVector3(); $pk->motion = $this->getMotion(); $pk->yaw = $this->yaw; $pk->pitch = $this->pitch; $pk->metadata = $this->dataProperties; $player->dataPacket($pk); parent::spawnTo($player); } public function getName(): string { return "Firework"; }}
Overwriting Entity::tryChangeMovement() with nothing may work, I haven't tested. PHP: protected function tryChangeMovement(){}
Try override method onUpdate (maybe, I forgot it name) and when your entity get a negative motion remove it.