From 8b1ef36dc538d2fa4c6c21c0485691e254d3c20c Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 26 Feb 2026 02:34:10 -0500 Subject: [PATCH] Anchor Point Eye Fix --- src/api | 2 +- src/main/java/kamkeel/npcs/util/AnchorPointHelper.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/api b/src/api index 52cfe77bb..aac5f98be 160000 --- a/src/api +++ b/src/api @@ -1 +1 @@ -Subproject commit 52cfe77bb776f10db17137ddb623503d8fe52ad0 +Subproject commit aac5f98be85b2004f61733c1c97bdae26329a714 diff --git a/src/main/java/kamkeel/npcs/util/AnchorPointHelper.java b/src/main/java/kamkeel/npcs/util/AnchorPointHelper.java index 2da72ac7c..ad0cefe9e 100644 --- a/src/main/java/kamkeel/npcs/util/AnchorPointHelper.java +++ b/src/main/java/kamkeel/npcs/util/AnchorPointHelper.java @@ -112,9 +112,12 @@ public class AnchorPointHelper { break; } - // Rotate offsets relative to entity's body yaw + // Rotate offsets relative to entity's yaw + // EYE anchor uses head yaw so offsets follow the look direction + // All other anchors use body yaw // +X = entity's right, +Y = up, +Z = entity's forward - Vec3 rotatedOffset = rotateOffsetByYaw(anchorX * scale, anchorY * scale, anchorZ * scale, bodyYaw); + float offsetYaw = (anchor == AnchorPoint.EYE) ? headYaw : bodyYaw; + Vec3 rotatedOffset = rotateOffsetByYaw(anchorX * scale, anchorY * scale, anchorZ * scale, offsetYaw); x += rotatedOffset.xCoord; y += rotatedOffset.yCoord; z += rotatedOffset.zCoord;