Jessica Mendoza and Jamie Foxx will both return to this year’s softball game. (Associated Press photos)

Last year at Marlins Park, with her black cleats planted in the manicured paspalum grass in center field, Jessica Mendoza lived a dream that had only felt possible in childhood daydreams. Her career had taken her many remarkable places — the Women’s College World Series with Stanford; Olympic Games in Athens and Beijing with Team USA; the “Sunday Night Baseball” broadcasting booth with ESPN — but she had never stumbled into an experience at once so nostalgic and surreal as the one she found at Major League Baseball’s all-star Sunday.

As the captain of the AL team at the 2017 Legends & Celebrity Softball Game in Miami, Mendoza found herself wearing the same ocean-blue jersey, gray pants and red-orange socks as nine-time all-star Fred Lynn, a former batting champion who won both American League MVP and rookie of the year honors with the Boston Red Sox in 1975. Not only was Lynn, a player Mendoza idolized as a child, setting up in right-center next to her, but he was calling her over to talk shop.

As a veteran of 17 MLB seasons, Lynn was so infected with the baseball bug that he had been analyzing the swings of the actors, musicians and fellow graybeards on the opposing roster. When he turned to Mendoza and said they should think about playing a little shallow for a certain hitter, she had the sensation that she had just been called up to the big leagues.

“For a moment, this is like what it was like to play for the Red Sox,” Mendoza said in a phone conversation last week. “This is really cool, Fred Lynn telling me exactly how we’re going to play the outfield. Every out mattered. That to me is just the essence of the game, the person that just loves the game.”

The singularity of that experience made it an obvious choice for Mendoza to accept an invitation to return for this year’s Legends & Celebrity game, which will follow the Futures Game on Sunday at Nationals Park. Mendoza will join a varied cast of athletes and pop culture personalities including Washington Wizards point guard John Wall, Redskins cornerback Josh Norman and Bill Nye the Science Guy. The game will be shown on ESPN on Monday night.

Mendoza, who in 2015 became the first female analyst to call a baseball game on ESPN, had wanted to participate in the celebrity game for years, but her broadcasting schedule didn’t allow it until last season. It was important to her to join her former Olympic teammate Jennie Finch, who captained the National League squad last year and will play again Sunday, in representing women who could hold their own in the competition.

Although she was a four-time college all-American and literally has her name on a line of metal Louisville Sluggers, Mendoza knew that her fast-pitch experience wouldn’t translate to the pace she would face at Marlins Park. So she developed patience at the plate by enlisting her husband to lob her slow-arcing pitches.

“It’s a totally different game,” she said. “I made sure that I went out and at least figured out how I can hit.”

Among the legends and celebrities, Mendoza said, there exist two types of personalities: competitors and goofballs. At last year’s exhibition, the atmosphere was equal parts intense and lighthearted. There was Lynn doing his outfield calculus, but there was also Pro Football Hall of Famer Jason Taylor attempting to tackle baseball Hall of Famer Rickey Henderson after a home run.

Mendoza was equally star-struck elsewhere in the outfield, where Jamie Foxx — a three-tool standout as a stand-up comic, Oscar-winning actor and Grammy-winning R&B singer — patrolled. Foxx had game, but he would also pause to yuk it up with fans. He is slated to play again this year.

“I was jokingly yelling at him like, ‘You got to be more focused!’ And of course the next play he makes a diving catch,” Mendoza said.

Organizers for the game determine the lineups, and everyone gets a chance to play, so captains are spared the potentially ego-bruising managerial task of determining a No. 9 hitter. But captains do retain the right to give pitchers the hook.

That led to an infamous moment 10 years ago at the old Yankee Stadium. Mike Greenberg was managing against his old ESPN radio partner Mike Golic. It was a magical night for Greenberg, a New York native whose parents were raised in the Bronx, but the crowd would turn against him in the bottom of the sixth inning. Wade Boggs, who made four of his 12 all-star teams with the Yankees, was up to bat, and Greenberg trotted to the mound to talk to his pitcher, “Desperate Housewives” actor James Denton.

“I said, ‘Jim, we’re putting this guy on,’ ” Greenberg said. “He said, ‘What does that even mean?’ ”

After explaining that he was actually electing to utilize an intentional walk in a celebrity softball game, Greenberg told his pitcher they preferred to throw to ESPN’s Kenny Mayne, who was on deck.

“I got booed so loudly it was just astonishing,” Greenberg said. “But we won the game.”

Greenberg said that moment stands out most from his two years participating in the game. The intentional walk, Greenberg insisted, was not a product of taking the game too seriously. Yes, he wanted to win. But he also wanted to troll Golic.

“I would never have intentionally walked Wade Boggs,” he said, “if I didn’t think it was funny.”

From Greenberg’s perspective, the point of the game is to enjoy the experience and to entertain the crowd. By that philosophy, corkscrewing the ground on a failed fielding attempt is just as valuable as a bases-clearing double.

Greenberg’s own goal, he remembered, was not even to get a hit. He didn’t undergo any extra training to play in the game. His recreational softball experience was good enough for him. He just wanted to make an out to a legend, not a celebrity. Getting thrown out by Paul Molitor would have been pretty cool, but that’s not what happened in the two at-bats he remembers.

“I lined out to a Backstreet Boy and I grounded out to Billy Crystal,” Greenberg said.

If enjoying the star-studded company is the primary objective, there’s an equally important one that Andre Dawson — the Hall of Fame outfielder and former NL MVP who played most of his 21 seasons for the Montreal Expos and Chicago Cubs — likes to tell newcomers to the game.

“The one thing I always say to other celebrities: ‘Listen, you want to go home the same way that you came. Ease into everything.’ You don’t want to get a pulled hamstring, pulled groin or anything like that,” said Dawson, who will play at Nationals Park and has been a staple of the game for years.

That said, Dawson will cop to ignoring his own advice. His competitive juices were flowing when a flyball was hit his way with the bases loaded a few years ago in Cincinnati. As soon as he released the throw home, he knew his shoulder was toast. The toss from right field only made it to first, and Dawson had torn his rotator cuff and his labrum.

Now Dawson, who turned 64 Tuesday, prefers not to play the outfield.

“I would love to catch,” he said with a chuckle.

As with Mendoza and Greenberg, some of Dawson’s favorite stories come from the six or so hours of downtime before the game, when legends and celebrities get to gush over each other and share stories. It was impressive, Dawson said, to hear Dodgers fan Snoop Dogg recall elaborate details of Dawson’s performances in Los Angeles. Greenberg got a kick out of volatile college basketball legend Bob Knight vehemently complaining about his place in the batting order. Mendoza was in awe of Foxx’s ability to say yes to every fan’s request without betraying a hint of annoyance.

For one day of the year, most everyone involved seems to shed their egos and celebrate each other. Because at one point in all of their lives, they were all just fans under the spell of baseball.