Cavaliers vice chairman and minority owner Jeff Cohen knew it would be hard to duplicate his past success when he walked into the draft lottery room Tuesday night.

Cohen had represented the Cavaliers each of the previous three years, and the team netted the No. 1 overall pick in 2011 and 2013. With Cleveland slotted ninth in this year’s lottery, having just 17 of the 1,000 winning combinations, the chances of him pulling off another miracle were low.

Still, Cohen had faith that things would work out for him and the Cavaliers once again.

“I came in here believing we would win the No. 1 pick,” Cohen said after the drawing had been completed. “I was like, ‘I feel like we’re gonna pull this off.’ ”

***

The NBA Draft Lottery has become a made-for-TV production, with the eyes of the league annually turning to the Loser’s Ball in Times Square to see how the first 14 picks of the draft will shake out.

But as for the actual lottery process itself? It’s about as exciting as you would think pulling a series of pingpong balls would be.

The real lottery — not the one everyone sees on television — began at nine minutes and 52 seconds past 7 p.m., when the door closed on a small conference room in the bowels of ABC’s Times Square studios just a few yards away from the set seen by millions of TV viewers when the results are announced.

After the lottery is completed, those who know the results spend the next 75 or so minutes waiting inside the room for the televised event to take place, laughing at the awkward exchanges and reactions as it unfolds. On this night, the highlight for everyone in the sequestered room was seeing Julius Erving’s face turn into a scowl when the 76ers were given the 10th pick in the draft (completing a previous trade with the Pelicans). Apparently no one told him the Sixers had a chance to win two lottery picks.

Once the door closed, with the roughly 30 people inside the room — including five journalists — having given up their phones and other devices capable of communicating with the outside world, Jame Dershowitz from the NBA’s legal department took over.

Dershowitz was an emcee of sorts, going through the process of introducing the various officials in the room — including NBA executive Joel Litvin; a representative from Ernst & Young who was overseeing the process; and NBA vice president of basketball operations Kiki Vandeweghe, who would read out each pingpong ball as it was pulled out — and going through various “disaster scenarios” that could take place.

One such scenario was that if there were a power outage or blackout in the middle of the proceedings, or if the machine stopped working. In that event, the rest of the lottery would play out by drawing pingpong balls out of a plastic basketball with a removable top.

“None of these have ever happened before,” Dershowitz stressed, drawing a light chuckle from the room.

Once he finished with the brief introduction, the lottery began, and the attention of everyone in the room locked in on the clear plastic lottery machine with 14 pingpong balls bouncing around inside.

The process itself is fairly mundane. League employee Kyle Yelencsics stood in the back of the room with his back to the proceedings, looking at a stopwatch. After 20 seconds, Yelencsics would lift his hand and the lottery machine would spit out a number. Vandeweghe would then announce the number to the room, and the process would repeat itself, with the second, third and fourth balls being selected at 10-second intervals.

With 13 teams anxiously awaiting the results (the Nuggets held the rights to the Knicks’ unprotected first-round pick), Yelencsics raised his hand for the first time, and the process got under way.

***

NBA teams had spent this season, if not multiple seasons, working toward this moment. The loaded 2014 draft class has been touted for the past two or three years, so moving up into one of the top spots in the draft has the potential to transform each of the franchises in the room.

No one knew that better than Cohen, whose Cavaliers landed LeBron James 11 years ago. When James left in the summer of 2010, their efforts to jump-start the franchise began with an improbable jump from eighth to first in the 2011 draft lottery that led to them selecting Kyrie Irving.

So as Vandeweghe started reading off numbers for the first pick — first calling out 13, then 7, then 9 — the teams in the front of the room with the most No. 1 scenarios knew they were in trouble because of all of the high numbers being called out.

(When the teams sit down, they are given a packet with assignments for each of the 1,001 combinations of four numbers, except 11-12-13-14, which is not assigned to a team. The combinations begin with the worst teams — the Bucks, with the best odds at No. 1, got the first 250 possible combinations — and progress to the Suns, who had only five. The three teams in the front row — the Bucks, Sixers and Magic — knew they needed a 1 or a 2 to have a chance of winning the top selection. Higher numbers were good news for teams assigned fewer permutations.)

Cohen thought he had a chance, and decided to start concentrating on a number he knew would help: 14, the highest number available.

“I just kept saying, ‘Give me a 14! Give me a 14!’ ” Cohen said.

Vandeweghe called out a 14, and said the winner of the first pick was the Cavaliers.

Cohen responded to the news by clenching both of his fists, then rubbing his hands on his head and shaking his head, barely believing his luck. He hopes a third No. 1 pick in four years will be the last time Cleveland will be in the lottery room for a long time to come.

“I think this is what it’s going to take to get Cleveland the championship we promised them,” he said.