Hey! I've seen this animation(player moving) where when an ender pearl lands, it dashes the player to the location where the ender pearl landed. I've tried ProjectileHitBlockEvent with setMotion() but it didn't seem to work. My attempt: PHP: // ProjectileHitBlockEvent$projectile = $event->getEntity();$owner = $projectile->getOwningEntity();if($projectile instanceof \pocketmine\entity\projectile\EnderPearl){ if ($owner instanceof Player){ //$projectile->flagForDespawn(); //$coord = new Vector3($projectile->getX(), $projectile->getY(), $projectile->getZ()); //$owner->setMotion($owner->getMotion()->multiply(2.0)); //var_dump($owner->getMotion()->add(2.0)); $owner->setMotion($owner->getDirectionVector()->multiply(2.0)); var_dump($owner->getDirectionVector()->multiply(2.0)); } What am I doing wrong, and if it is impossible with what I am currently doing, what else can I do?
Yea use a ProjectileHitBlockEvent but instead of getting the player to run to the landed pearl, maybe teleport the player to the pearl unless you want the player to dash into it.
teleporting to the pearl is what it originally does. I want the player to dash(move) to the pearl on land
To set the motion to go towards the pearl you can do PHP: $owner->setMotion($projectile->subtract($owner));
Hmm it seems you have to cancel EntityTeleportEvent, or override Enderpearl's onHit() to prevent the teleport. Since teleporting resets the motion it might seem like it didn't have any effect
Ah..I see. Thanks for the reply. I also think I found a way, but I can't get it as smooth as SynHCF's pearl system. I guess marshall(CortexPE) is really a mysterious guy...