The Cave of Trials! (Japanese: ルカリオVSバシャーモ！試練の洞窟！！Lucario VS Bursyamo! The Cave of Trials!!) is the 31st episode of the XY series, and the 830th episode of the Pokémon anime. It first aired in Japan on June 5, 2014 and in the United States on August 16, 2014.
Our heroes and Shalour Gym Leader Korrina have arrived in Geosenge Town to look for a Lucarionite, the Mega Stone needed for Lucario's Mega Evolution. A photographer points them to a mountain cave but warns them it might be dangerous. Sure enough, when they get to the cave, the Team Rocket trio come flying out, propelled by some unseen force! But Korrina is determined to keep going.
Inside the cave, they find the Lucarionite—but it's guarded by a powerful Blaziken, who challenges Korrina and Lucario to a battle! It's a bad matchup for Lucario, and Blaziken's speed is intimidating. Korrina refuses to give up, and Lucario has almost won when someone calls the battle to a halt! It's Korrina's grandfather, the Mega Evolution guru known as Gurkinn. Now that Korrina has proven herself worthy, Gurkinn invites her to claim the Mega Stone she’s been looking for. Lucario's Mega Evolution is close at hand!
The group arrives excited to Geosenge Town, where the Lucarionite is located. However, Korrina does not know the actual location of the stone, only assuming she would because her grandfather told her she would know once she arrived at the town. After witnessing evolutionary stones in action, the group decides to split up to look for the Lucarionite in the surrounding shops, but to no avail. Due to their inability to attain information, Clemont deduces that the stone must be both valuable and rare. Korrina remembers her grandfather telling her that when the time is right, she will know what is needed for Mega Evolution. She resolves not to be discouraged.
Just then, a photographer appears, welcoming the travelers. He introduces himself as a local named McGinty and offers to take a souvenir photo of the Trainers, to which they accept. While the photo is being taken, Serena can be seen moving closer to Ash. He tells the group that evolutionary stones can be found in the caves within the surrounding mountains. Though McGinty does not know what a Lucarionite is, he does know of a remote cave in which a special stone can be found. He warns them, however, that if someone unqualified may enter the cave, something terrifying will happen. However, Korrina is unfazed, if not more determined. From behind a rock, Team Rocket listens. They decide to reach the cave first and steal the Mega Stone, as well as capture Pikachu. The group receives their souvenir pictures and heads off in search of the Lucarionite. As he watches them go, McGinty wonders if that was what Gurkinn wanted.
Up on the mountain, Team Rocket works on disguising the entrance to the cave, hoping to mislead the Trainers while entering the cave themselves. It is initially effective, as the travelers, led by Korrina, pass it by. Inside the cave, Team Rocket reach a door, while the Trainers outside remain lost. Suddenly, Lucario senses the direction of the Lucarionite and blasts open the disguised road's entrance. A further ways down, it senses the mouth of the secret cave. Clemont produces a machine to make light in the dark passage, and the group prepares to set off.
However, the group is frightened by loud noises from the depths of the cave, and Team Rocket flies out, blasting off again. Despite the danger, Korrina is determined to find the stone, and the Trainers advance into the cave. The party come to an open door, revealing a large chamber with a single path leading to the Lucarionite. However, as Korrina and Lucario run down the path, they are blocked by a Blaziken, who begins to battle with Lucario. Korrina and Lucario realize that in order to get the stone, the pair must defeat Blaziken.
Korrina begins with Lucario's Power-Up Punch. Blaziken dodges and returns with a Blaze Kick, which hits its mark. Lucario, however, lands on its feet and dodges Blaziken's next series of successive Blaze Kicks. Korrina commands Lucario to use Metal Sound, which allows it to run up for a Power-Up Punch. Just as it seems the move is working, Blaziken sends Lucario to the ground with a Flamethrower. As Korrina runs for the downed Lucario, her souvenir photo falls from her pocket and burns in Blaziken's flames. She falls to the ground. Blaziken grabs Lucario by the head and throws it against the wall, where it falls to the water below. Serena decides she can't watch any longer, but Ash stops her from interfering, telling her that it is Korrina's fight.
Reminded of her will by Ash's words, Korrina gets Lucario to stand up. She commands it to use Power-Up Punch, and Lucario attacks Blaziken. Blaziken dodges Lucario's successive punches, but Lucario finally pins its opponent down with a Bone Rush. Just when Lucario is about to finish Blaziken off with another Power-Up Punch, a voice commands them to stop. From the shadows emerges Gurkinn, Korrina's grandfather and the Mega Evolution Guru, who tells Korrina she won. The Blaziken was his. He tells Korrina that he knew she would end up in the cave, and wanted to provide her final trial himself. Korrina finally takes the Lucarionite in her own hands.
Back from the mountains, the group and Gurkinn run into McGinty, who promises to print another picture for Korrina. The group is surprised to find out that McGinty knows Gurkinn, who admits that Gurkinn enlisted him to help with the final trial. The group congratulates Korrina for achieving her goal. Korrina finally uses Mega Evolution with Lucario for the first time.