Oculus VR chief technology officer John Carmack was desperate to get the block-building open-world game Minecraft into virtual reality, but it took a lot of effort and a meeting between two of the most powerful people in tech to make that happen.

At the Oculus Connect developer conference in Hollywood today, Carmack explained that, for him, VR gaming is all about exploring worlds. He explained that cresting a hill to see a beautiful vista “means something” when you’re in a head-mounted display, and he could think of no better game to bring that kind of experience alive than Mojang’s exploration-heavy phenomenon. So he got to work convincing Mojang and, eventually, Microsoft to let him make that happen — but he needed the power of Mark Zuckerberg to finally seal the deal.

“Minecraft was my quest, really, for the last year and a half,” Carmack said. “Before Gear VR even existed, Minecraft was something I was desperate to get into virtual reality because I thought it would be critically important.”

Carmack explained that while Minecraft is a game about exploring, it also has a number of other aspects that make it ideal for VR. It’s a metaverse with an infinite number of worlds where people can put on different skins to play as different characters. And it was with that stuff in mind that Oculus invited Minecraft creator Markus “Notch” Persson into the office to talk about putting a version of the game into the Rift.

“We had Notch over,” said Carmack. “And we showed him early prototype stuff, and I talked with him about geeky programmer stuff for a long time. We were trying to get into a situation where he would let us try to put the [mobile] game on Gear VR — if it’s great, then we’ll see where we can go from there.”

But that didn’t work out right away. You might remember that when Facebook acquired Oculus in July 2014, Notch “blew up about it,” as Carmack puts it. Notch referred to the social media company as “creepy” and publicly stated that it wasn’t the partner he was envisioning when he backed the original Oculus Rift when it was just a Kickstarter project.

“Notch eventually got over that, and then there was the Microsoft acquisition,” said Carmack. “I started pestering Mojang about it. I would drive home this case that ‘we don’t want to ask anything from you. Just let me try to build this, and if you think it’s cool, then we’ll figure it out from there.'”

Carmack said he was so confident that Minecraft would work that he would agree to just about anything with Microsoft — and that seemed to do the trick.

“Microsoft actually got me GitHub access to the Minecraft: Pocket Edition code base,” he said. “But we signed a contract that our lawyers said was terrible. ‘They own everything you do. John, you’re basically working for Microsoft when you’re working on this.'”

But the CTO assured Facebook and Oculus’s legal team that this was worth it, and he got to work. Now, it’s up to him to get it up and running. He says he’s already given the framerate a boost and implemented head-tracking, which are the “fundamentals of VR.” But he’s also considering all kinds of other technical improvements — although, he notes that a lot of that stuff isn’t critical.

“It was amazing how quickly I was thinking to myself that I’m in the game and having fun,” he said. “I’ve played more hours of Minecraft in [Samsung’s] Gear VR than all other games put together. I still want to fix everything — I’ve talked to Mojang’s engineers about it. But it turns out that I wouldn’t say they are at all necessary for an initial release because I had an immense amount of fun with it.”

But despite all of that, Minecraft almost didn’t end up on the Oculus stage today. It took a last-minute emergency meeting to make that happen.

“I guess I can say this now. I got the email at 12:30 a.m. this morning that the deal was signed,” said Carmack. “We did all this preparation about how to announce it with the assumption that we would get to, but it really came down to the wire.”

Carmack said that after he did the initial work on Minecraft for VR about eight months ago, Oculus and Facebook spent the rest of the time trying to reach a deal with Mojang.

“I was willing to do just about anything,” he said. “On the phone I said that if this doesn’t happen, I’m going to cry. This will just be so terrible. This will be the best thing that we can do for the platform. But there are some problems that compilers can’t solve.”

It turns out that the solution was to get the top executives from Facebook and Microsoft together.

“Mark [Zuckerberg] and Satya [Nadella] were able to sit down and make sure that the deal happened,” said Carmack.

“I’ve called this my grail,” he continued. “I think it’s the single most important application that we can have to ensure we have an army of fanatic, passionate supporters that will advocate why VR is great. It’s part of this infinite playability that our current ecosystem is missing.”