mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
Returns xPos, yPos, distance for the nearest creature of a given NPC entry ID, or nothing when none is in range. Walks the visible-object manager (Loot::Nearby pattern), matches creatures whose GUID encodes the entry (bits 24-47, per guid/CreatureInfo), and returns the closest one's world position + center distance in yards. Semantic note: retail's ClosestUnitPosition reads a static client spawn database (starting-zone mobs only); vanilla 1.12 has none, so this returns the nearest CURRENTLY-VISIBLE creature of that entry (anywhere) — more general than retail, but can't point at un-synced spawns. Documented in docs/API.md.