Yoda was not originally in the script for The Empire Strikes Back, and it appears to be confirmed by his telepathic communication with Luke at the end of the film. However, Lucas required unequivocal confirmation for his third film and felt Yoda was the best character to deliver it.
George Lucas’ 1977 sci-fi classic Jedi Master Yoda — whom Luke seeks out on the remote world of Dagobah for Jedi training. This was meant to be Yoda’s final appearance in the Original Trilogy, but after consulting with a child psychologist, Lucas brought back the character for Return of the Jedi.
After rescuing Han and Leia from Jabba’s Palace, Luke returns to Dagobah to complete his Jedi training and discovers Yoda is dying. On his deathbed, Yoda tells Luke no more training is required but reveals Luke must confront Vader in order to become a Jedi. This prompts Luke to ask if Darth Vader really is his father, to which Yoda replies, “Your father, he is.” Yoda’s confirmation is the main reason for his appearance in the film, as explained by George Lucas in the 2004 DVD release. Prior to making Return of the Jedi, Lucas consulted with a child psychologist who said children age twelve and under would dismiss Vader’s fatherhood claim as a lie unless it was unequivocally stated that Vader was, in fact, Luke’s father. Lucas determined Yoda would be the best character to confirm this truth. Although not originally scripted, Yoda’s Return of the Jedi scene does provide further context to the events of The Empire Strikes Back.
Yoda regards Vader’s reveal as “unforeseen” and “unfortunate,” something Luke incorrectly infers as Yoda wishing to conceal the truth. Yoda explains it was unfortunate not that Luke knows the truth, but that he rushed to face Vader before completing Jedi training and was thus not ready for the burden. A Jedi’s strength comes from the Force, something Luke had not mastered upon his first meeting with Vader. Yoda warns that anger, fear, and aggression are emotions of the dark side, a path that, once taken, will forever dominate Luke’s destiny. Had Luke waited to confront Vader until his training was complete, he would have been better suited to handle the emotional burden of knowing Vader is his father and thus less likely to give in to the anger, fear, and aggression that undoubtedly came as a result of his newfound knowledge.
Jedi Master Yoda reappears at the end of Return of the Jedi as a Force Ghost alongside Obi-Wan Kenobi and a redeemed Anakin Skywalker, Luke's father, providing a fitting end to the Jedi Master's journey. Yoda goes on to become an integral part of the Star Wars Prequel Trilogy and even appears in the Disney Sequel Trilogy, something that may have never occurred had it not been for George Lucas' need to confirm Darth Vader is Luke's father.