New York Mets manager Terry Collins congratulates Yoenis Cespedes and...

New York Mets manager Terry Collins congratulates Yoenis Cespedes and his teammates after their 10-5 win against the Philadelphia Phillies on Sept. 23, 2016. Credit: Kathleen Malone-Van Dyke

One of these years, it’s going to happen.

Ever since baseball went to the double wild-card format in 2012, the chance for a three-way tie for the two spots — and the delicious chaos that would ensue — has been a possibility.

This year, the Mets are smack-dab in the middle of that dream (or nightmare) scenario. At various points in the last week, they were tied with San Francisco and St. Louis for the two NL wild-card spots.

If the three teams end the season after next Sunday’s games with identical records, a tiebreaker format that never has been used will be activated. The three teams will play a total of two play-in games to determine which two teams earn the wild-card berths.

The two surviving teams will then play in the wild-card playoff game and the chance to face the NL’s top seed (which will most likely be the Cubs) in the NLDS.

Play-in games basics

 Play-in games are considered regular-season games, meaning the stats will count for the regular season and teams will have expanded 40-man September rosters.

 The rules for a three-way tie include a provision by which the teams are designated A, B and C and Team A gets a choice to play one or two play-in games. If Team A chooses two games, Team B gets the same choice. But trust us, no team is going to choose to have only one shot to make the postseason when it could have two. So we’ll ignore that for now and apologize later if it turns out we were wrong.

This is where it gets dicey for the Mets: They end the season next Sunday in Philadelphia. If the three teams tie, the Mets would fly to St. Louis for a play-in game on Oct. 3.

If the Mets win, they go home and, on Oct. 5, host the winner of the Cardinals-Giants play-in game that would be played in San Francisco on Oct. 4.

But if the Mets lose on Oct. 3, they fly to San Francisco for a play-in game against the Giants on Oct. 4. If the Mets lose that, their season is over.

If the Mets win, they fly back to St. Louis for the wild-card playoff game on Oct. 5. That game is a postseason game and will be played with a 25-man roster submitted that morning.

If the Mets beat the Cardinals, they most likely fly to Chicago to open the NLDS against the Cubs on Oct. 7. A new 25-man roster will be chosen before Game 1.

So in the worst-case travel scenario for the Mets, they could play in Philadelphia, St. Louis, San Francisco, St. Louis again and most likely Chicago in a span of six days.

With Matt Harvey and Jacob deGrom (and probably Steven Matz) out for the season, there’s no chance the Mets want to play any extra games just to make the postseason.

Manager Terry Collins, asked if he had studied the tiebreaker scenarios, said: “Not right now.”

Can’t say we blame him. It would behoove the Mets (or the Cardinals or Giants, for that matter) to avoid this situation entirely if they want to make some noise in the postseason.

“There’s no question,” Collins said. “I think it’s not just the state of our pitching, but the health of our club in general. We’ve got a couple of guys that are playing through a couple of issues that certainly that day off here and there will help out. If we can avoid any two-game playoffs, that’d be beneficial to us.”

Oh, if the Mets finish in a two-way tie for the second wild-card spot, they would simply visit the Cardinals or host the Giants in a play-in game on Oct. 4.

Now, if the Marlins or Pirates get hot and there’s a four-way tie . . . Ah, that’ll never happen. Right?

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 5 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME ONLINE