Pinkymod/Totem of Warding

The Totem of Warding is a Hardmode which while active will make all Town NPCs immune to damage, it can be activated or deactivated by right-clicking it.