I want an entity to draw a trajectory and move 5 blocks horizontally and 4 blocks vertically in a direction where a player is looking in the end.
I have tried below, but the entity moved further and higher.
Vector3d vector = player.getLookVec().normalize().mul(5, 1, 5);
entity.setMotion(vector.x, 4, vector.z);
How can I derive the motion from desired distance and height?