Commit a29943ae by Jonathan Thomas

Fix LookControls regression to target players eye line (and not feet)

parent b0ec4a59
Pipeline #12724 passed with stages
in 1 minute 59 seconds
......@@ -12,7 +12,12 @@ import net.minecraft.util.math.Vec3d;
*/
public class LookControls {
public static void lookAtPlayer(ServerPlayerEntity player, MobEntity entity) {
lookAtPosition(player.getPos(), entity);
// Get the player's eye line position
Vec3d playerPos = player.getPos();
float eyeHeight = player.getEyeHeight(player.getPose());
Vec3d eyePos = new Vec3d(playerPos.x, playerPos.y + eyeHeight, playerPos.z);
lookAtPosition(eyePos, entity);
}
public static void lookAtPosition(Vec3d targetPos, MobEntity entity) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment