The Necromancer is a Hardmodedungeon enemy. It will spawn in the dungeon only after Plantera has been killed.
It attacks by firing beams of purple light 6 times at the player, then teleporting and repeating. These beams are extremely dangerous, as the beams deal significant damage, reflect multiple times off walls and travel instantly, making it difficult to reasonably avoid its attacks. It also inflicts the Slowdebuff.
Whenever it is attacked, it will instantly teleport. With this and its attacks, it makes the Necromancer frustratingly hard to kill.
They are immune to the Poisoned and Venom debuffs and only spawn in dungeons with a Brick Wall.
Tips
A Necromancer's attack is always directly aimed at the player, regardless of obstacles.
Weapons that deal high damage in single hits are effective against Necromancers. Weapons that fire multiple projectiles simultaneously may be able to land multiple hits before they teleport as well.
Homing weapons can continue to track Necromancers after they teleport.
Minions are effective against Necromancers, as they will automatically find and track enemies outside of the player's line of sight. Many can pass through walls to reach Necromancers as well.