Hello, I'm trying to make a plugin where an entity follows a player, I got everything alright, but I get stuck because the update movement that I made on EntityBaseTick updates everytime I hit, I'd like it to update simply everytime.
PHP: public function updateMove($tickDiff){ $yaw = $this->target->getYaw(); $this->yaw = $yaw - 180; $this->move($this->target->motion->getX() - $this->motion->x * 1.35, $this->target->motion->getY() - $this->motion->y * 1, $this->target->motion->getZ() - $this->motion->z * 1.35); return; } this is how I move player, also the head is rotating without me having to hit the human, but the move is only when I hit
It seems like the variable $target is only acquired when you hit the entity can you show the whole code?