What in the world was JaVale McGee thinking?

Scratch that. He wasn’t thinking. Isn’t thinking often a problem with the Wizards?

Exhibit A: Gilbert Arenas.

Well, they jettisoned Arenas, but apparently not using the old noodle is contagious. Andray Blatche apparently caught it, and so did McGee.

Monday, against the Rockets, with the Wizards trailing by six, John Wall picked up a loose ball and threw it to McGee, all alone on a fast break. Time for a dunk, of course; McGee was picked for the dunk contest during last year’s NBA all-star weekend. He’s got uncommon skills.

He’s also got no common sense. He decided to toss an alley-oop pass off the glass to himself, dunked the ball with both hands, then saluted the crowd as he ran down the court.

Flip Saunders probably wanted to slap his own forehead, or maybe McGee’s, but he settled for putting his hands on his waist and looking put out. But not as put out as the Rockets, who went on a 19-4 run and won the game, 114-106, despite 38 points from Wall.

That left the Wizards with a 1-12 record. That’s one win and 12 losses. The Washington Generals won more games.

Saunders called McGee’s dunk “unacceptable.” McGee’s reaction: “Apparently, if you get a fast break and throw it off the backboard in the third quarter, and you’re 1-11, you’re not supposed to do stuff like that.”

So, lesson learned, right? Wrong. When asked if he regretted doing it, McGee said, “No.”

McGee explained he was trying to motivate his teammates. “I felt like I did that, and we went on a run from there.”

Well, no, the Rockets went on a run, not the Wizards. Six minutes after McGee’s vanity play, the Wizards trailed by 19 and had made as many technical fouls (two) as field goals. McGee is not perhaps the inspirational leader he thinks he is.

The Wizards did make a run when Saunders benched McGee in favor of Blatche for the final nine minutes. So in a way, McGee did trigger a run by his team. Hopefully he won’t let it go to his head.

The truth is, McGee was trying for a highlight reel dunk, because the all-star game is once again coming up. And sure enough, his dopey move made the top plays on “SportsCenter” — where it was roundly criticized by ESPN commentator Jalen Rose, who put the blame for such boneheaded moves on . . . ESPN. Refreshing.

But whether or not you liked McGee’s move, he’s getting a lot of attention today. For the Wizards, however, it’s more of the same. Another loss, another chance to be ridiculed as the most dysfunctional team in the NBA, and perhaps in all of professional sports. The Wizards have been attracting attention since Arenas’ antics, and with the exception of winning the lottery and landing Wall, nearly all of it has been bad.

Wall, McGee and Blatche are supposed to be the core, but the Wizards’ rebuilding program clearly is going to have to cut deeper. Blatche is a hot mess, and McGee is talented but clearly clueless. Nick Young thinks McGee’s dunk was “brave.” It’s no wonder Wall frequently looks unhappy. He’s 21, and in addition to being the most talented player on the floor, he’s got to be the most mature, too.

McGee is tall and talented — and tradable (which is more than can be said for Blatche and his bloated contract). At some point the Wizards are going to have to decide whether they want to continue to be the laughingstocks of the NBA, or if they want to keep supplying the all-star game with dunking talent. Or they need to find a way to get these guys to grow up.

For McGee, Rule 1 might be this: Until Blake Griffin dunks over a car during a game, save the theatrics.