Kingdom Hearts 3D: Dream Drop Distance covers the events revolving around Sora and Riku’s Mark of Mastery Exam. To face the impending threat of Xehanort’s return, Master Yen Sid tasks Sora and Riku with entering the Sleeping Worlds and unlocking the seven Keyholes of Sleep to obtain a great power necessary for the fight to come.

When they enter the Sleeping Worlds, Sora and Riku are brought back to their home on the Destiny Islands, just before the night of the storm that swallowed their world and plunged it into darkness. In the middle of their Exam, a mysterious boy in a black coat interferes and plunges Sora into sleep. Riku, without even knowing it, follows Sora into his sleep in order to protect him from whatever dangers lie ahead.

Sora and Riku end up in Traverse Town, a world designed to appear when people are in need of a place to go. Though they were separated, the two of them discovered that they could still reach each other through portals that connect the different halves of the Sleeping Worlds.

The two of them travel to many different worlds, solving the various troubles that plague them, and sealing the Sleeping Keyholes as they go. All the while, the boy in the black coat continues to appear interfere with Sora and Riku’s task.

Meanwhile, in Radiant Garden, the some of the former members of Organization XIII are starting to wake up as their former selves. Lea, Ienzo, Dilan, Aeleus, and Even all awaken in Ansem’s Lab with full memories of who they were, as well as memories of their time in the Organization.

As events begin to take a turn for the worse, Mickey becomes restless and enters the Sleeping Worlds in order to find Sora and Riku. Their journey takes them all to The World That Never Was, where the boy in the black coat reveals himself to be a younger Master Xehanort from the distant past. He has been traveling to different moments in history, collecting different versions of himself and bringing them together in order to welcome the return of the true Master Xehanort.

Master Xehanort’s goal is to recreate the X-Blade and gain access to Kingdom Hearts. After the first Keyblade War, the X-Blade was shattered into 20 pieces; seven of Light and thirteen of Darkness. As a result of the X-Blade’s destruction, Kingdom Hearts became lost, unattainable without its guardian, the X-Blade. Master Xehanort is attempting to recreate the thirteen darknesses by finding thirteen vessels from various points in time and fill them all with Master Xehanort’s heart and mind.

Originally, Xehanort had plans to bring Riku in as the thirteenth vessel, since Riku had once been possessed by Ansem. However, Riku developed a sort of immunity to darkness over the years, and Xehanort lost interest in Riku as a host. He then turned his attention to Sora and plunged him into the Sleeping Worlds within his own heart. Xehanort was about to claim Sora as his thirteenth vessel when Riku, Mickey, and Lea showed up in time to rescue Sora and interrupt the process.

Retreating to Yen Sid’s tower, Sora’s heart remained trapped in sleep. Riku was able to enter Sora’s sleeping heart once more and rescue him from the Nightmare that was trapping him there. Riku returned to the real world to find Sora awake and back to normal.

In light of all the events that transpired, Yen Sid confirmed that only Riku had exhibited the Mark of Mastery, and granted him the title of true Keyblade Master. Now in an effort to gather seven lights to combat Xehanort’s thirteen darknesses, Riku is tasked with bringing another warrior of the Keyblade to Yen Sid’s tower: Kairi.