When diagnosing what ails the millennial generation, there is a tendency to blame the same old foes — parental coddling and the rise of mobile phones. Instagram filters = detachment; participation trophies = entitlement. But alongside those obviously nefarious factors is a sneaky force that’s perhaps even more pervasive: popular fiction.

So many of the most popular books and films over the past 20 years have been all about how a person is born amazing, stays amazing, and then goes on to kick ass while facing little, if any, adversity. Where once our heroes had to work hard to earn any kind of glorified status, today all that’s required of them is good genes, some teenage angst and healthy opposable thumbs.

Since Harry Potter debuted in 1997, inspirational Messiah complexes have become the choice vehicle for stories aimed at young people. Who can blame book publishers and movie studios for copying such a successful formula over and over? According to Scholastic, 400 million Harry Potter books have been sold worldwide, and the films have netted $2.4 billion. Making kids feel special is big business.

Take the new movie “The Dark Tower,” based on Stephen King’s book series. It’s about an 11-year-old New York boy named Jake, who’s bullied at school and obsesses over a magical land that he has strange dreams about. Eventually Jake goes on an adventure to this place, called Mid-World, and is praised by its people for his psychic powers and his off-the-charts “shine” — a measure of how extraordinary somebody is.

But the story could also be interpreted as Jake accomplishing nothing. He prevents the destruction of Earth by tagging along with Idris Elba and taking all the credit for 95 minutes.

And do-nothing Jake and the “Dark Tower” film, which deviates significantly from King’s more complicated books, probably wouldn’t exist were it not for Harry Potter.

J.K. Rowling’s novels are credited with giving an entire generation its enthusiasm for reading. But they might deserve props for giving an entire generation its unearned delusions of grandeur, too. In “Harry Potter and the Sorcerer’s Stone,” we learn that Harry, who is also 11, has already saved the world once before. As a baby. When Lord Voldemort tried to kill the infant, the love of Harry’s mother forged such a protective spell, it vanquished the baddie on the spot.

As a preteen, Harry attends Hogwarts School, where most of his teachers bow to his magnificence. There Harry discovers he has a knack for performing difficult spells and flying broomsticks. He makes the school’s Quidditch (a sport played on said brooms) team his very first year. Sure.

Harry has multiple run-ins with Voldemort throughout the seven books, and, like Mark Zuckerberg with a wand, he always defeats them despite being a young student. See, Young Impressionable Minds? You, too, can ditch class and be exceptional!

This is a starkly different message from the hardscrabble one of the “Lord of The Rings” series, which was published throughout the 1950s.

In J.R.R. Tolkein’s saga, Frodo Baggins, a shy young hobbit, is whisked on a journey to destroy an evil ring of power — not because he’s “the one,” but because he wants to keep his friends safe.

On his trek, Frodo becomes skilled and savvy and eventually chucks that cursed bling into the fires of Mount Doom, destroying it and the dark Lord Sauron. No fanfare, just a job well done.

But the most glaring example of the recent shift toward heroic ego-mania? “Star Wars.”

The main character of the 1970s and ’80s film trilogy, Luke Skywalker, was pretty unremarkable. A space townie, really. He was a decent pilot with rockin’ hair who just wanted to move out of his aunt and uncle’s house. Not exactly destined-for-greatness material. But he was determined, and a little desperate.

“There’s nothing here for me now,” he tells Obi-Wan Kenobi after his family is killed. “I want to learn the ways of the Force and become a Jedi like my father.” Even if he is fated to save the galaxy, his motivations come not from feeling special but from feeling empty.

Plus, Luke doesn’t learn a damn thing about being a Jedi until the second film, “The Empire Strikes Back,” when he meets Yoda. At first, the easily frustrated dude stinks at using a lightsaber and moving objects with his mind. He doesn’t really become a force to be reckoned with until “Return of the Jedi.”

Skip ahead 40 years to 2015’s “The Force Awakens.” Rey is the hero now, and she’s instantly adept at Jedi mind tricks and can capably wield a lightsaber with zero training. What does she have left to learn? French?

This is not to say these books and movies shouldn’t be read and watched. Harry Potter and “The Force Awakens” are, by most critics’ estimations, excellent. But adults need to take fiction more seriously. Your kids sure do.