Hi, as the title mentions, some ranged mobs only attack when in melee range. The best examples are Swamp Warriors and Plando. This can be fixed by changing the AIType in their XML to ARCHER, but I'm not sure if that's actually the best option between BALANCED and ARCHER.
So, if the mobs don't have a bow, but attack from a distance with another type of weapon like Rhand: Lizard Spear, what is shown in the images happens.
I've included an album showing what I mean and how it looks with the change.
https://imgur.com/a/AQIYj2a