Entity.getNearbyEntities() is accessible within the Wither entity itself, and since the head is part of that entity, the method serves for all purposes in regards to withers