So, I have an idea for a quest that I might make some players go on at some time, however it all falls apart if a player can become immune to mind affecting, not because it would make the quest easier, but because someone would have already done it.
Even racial immunity to mind affecting would be a problem so long as it was a human derivative race (teifling as an example).
So is there any way to be immune to mind affecting?
Mind Buttressing armor enhancement.
Becoming a sentient undead (but then you're still subject to Control Undead).
Some classes/archetypes have it as a 20th level capstone (directly or indirectly - by becoming undead or elemental). Unbreakable archetype for fighter, for example.
I don't think Mind Blank gives you straight immunity anymore (it did in 3.5).
Straight out immunity is hard to achieve, there are many ways to be very very resistant via class abilities, spells and wondrous items.
I was aware of becoming undead, it's not a big deal for the plot, so no worries.
Mind buttressing doesn't give immunity to mind affecting, only a subsection, so it's fine
I realize, that while not 100% necessary I'd like to know if you can become immune to the emotion and phantasm spell descriptors too.
20th level capstones are not really on the table. But it's good to know.