So, there are a few weapons in Terraria that give the enemies confusion. if the player gets confusion, then their controls are inverted. I'm wondering how the confusion works for the enemy's AI since they don't have button controls.
As per the Terraria wiki, the Confused status effect causes mobs to move away from the player instead of towards them, and mobs with ranged attacks will be unable to shoot those attacks. Note that a vast majority (about 70%) of mobs are immune to the Confused debuff - it's mostly mobs that have either the slime or fighter AI that are affected.
Confusion causes Enemy AI's to move away from the player and mobs with ranged attacks cannot shoot them at you. Intrestingly, 70% of mobs are immune to the confused debuff, and including all the bosses. Some of the other mobs that actually apply this to the player are Giant bat, Light Mummy, Clown, Brain Scrambler, Brain of Cthulu and Creeper.