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;