"Battle for the Sunstar" is the twentieth episode of the second season of Ewoks. Written by Paul Dini and directed by Dale Schott, the episode originally aired on ABC on December 6, 1986.
Doctor Raygar, a scientist for Emperor Palpatine, has designs on ruling the Galactic Empire and travels to the Forest Moon of Endor aboard an Imperial Star Destroyer to obtain the powerful Sunstar from the Ewoks' Bright Tree Village. Admiral Kazz is skeptical that there is anything on that backwater "planet" that can be use to the Empire. Dr Raygar tells Kazz that what he believes does not matter since the Emperor himself has approved his expedition. Kazz is dismissive of the "primitive" Ewoks and dismisses it as one of his foolish ideas. Raygar resolves to obtain the Sunstar. Raygar orders the pilot droid PD-28 to follow him to his freighter, which departs from the Star Destroyer's hangar.
Meanwhile, Wicket, Kneesaa, Latara and Teebo are on an errand to carry jinjang berries to the guba bird's nest. Latara grumbles but Kneesaa says that it hardly rains on the hill and the baby guba will starve if not fed. Wicket grumbles about having to waste time not getting a trophy for his belt of honor while Teebo accidentally drops some berries and trips on the hill. Kneesaa tells Wicket that if he helps others, they will help him someday.
Kneesaa reaches the nest and brings the guba chicks some berries. Two of the gubas grab her with their beaks and carry her to the air. They drop her back on the nest, causing her and the other Ewoks to fall off the hill. Fortunately, the Ewoks land on a bush. Wicket and Latara scoff at Kneesaa's philosophy of helping others. Kneesaa asks if everybody is okay. The four Ewoks then hear an animal crying.
They find a little perkle trapped inside a dome–like trap. The four Ewoks try to free the animal but are unable to lift the dome like trap. Latara is then sucked by the machine's vacuum funnel inside the dome. Teebo tries to use his potion but the bottle gets sucked inside the trap, causing it to shatter and casting Latara and the perkle out. Kneesaa reluctantly thanks Teebo. The Ewoks inspect the broken trap and wonder where it came from.
Teebo is grabbed by an Imperial Reconnaissance Droid. Watching from above, Doctor Raygar laughs from inside his Battlefield Subjugation Floatie. As the Ewoks react with shock, Kneesaa is trapped in an energy beam by Dr Raygar's repulsorcraft. As more droids approach, Wicket tries to drive them away with his club but Raygar vaporizes it. Dr Raygar flies down to Wicket and Latara, telling them that even though his trap did not catch Ewoks it has led them to him.
When Wicket asks who he is, Dr Raygar introduces himself. He requests the location of their tribe's village in return for letting Wicket's friends go. Kneesaa pleads with Wicket not to give since Raygar is evil. Raygar threatens to destroy Wicket's friends and begins increasing the pressure on Kneesaa. The droid squeezes Teebo. To save his friends, Wicket tells Raygar to travel over the hill and follow the river until he reaches the great trees. Latara vows that the Ewok warriors will stop him before he sets foot in the village.
Raygar spares the Ewoks but orders his droids to imprison them aboard his ship. The droids carry the Ewoks aboard Raygar's freighter, where they are locked inside a cell reinforced by a force field. Dr Raygar tells the Ewoks that the force field will hold them long enough until he gets the Sunstar. He orders two of the reconnaissance droids to follow him and a third to guard the Ewoks' cell. Wicket says they need to get out and warn the village. Latara grumbles about the guba birds not helping them.
Shortly later, PD-28 enters the cell with a bowl of food. However, the recon droid guarding the cell grabs him and tells him that no one is to be admitted to the cell. PD-28 says he is only bringing food but the recon droid says that Dr Raygar has given orders that the prisoners not be fed. He throws PD-28 aside, causing the bowl of fruits to splatter on top of him. Watching the incident, the Ewoks particularly Teebo and Kneesaa pity PD-28.
Undeterred, PD-28 offers the Ewoks food through a slot in the back of the cell. Wicket asks if he could let them out. PD-28 is sympathetic but fears that Lord Raygar will destroy him if he lets them escape. Wicket convinces PD-28 to escape with them and the little droid helps them escape their cell through the food hatch.
While trying to find their way of the ship, Teebo leads them into the escape pod. Latara thinks that PD-28 can't be trusted but Kneesaa says that he wouldn't have helped them if he were not a friend. PD-28 explains that the pod is a form of transportation. Latara accidentally triggers the controls, causing the cockpit to deatch from the rest of the freighter and fly away. The droid sentry realizes they have escaped. Under PD-28's guidance, Wicket steers the control, avoiding several obstacles into trees and sentient mushrooms. Wicket struggles to fly the ship but eventually gets the hang of the ship.
Meanwhile, Raygar attacks Bright Tree Village with his Battlefield Subjugation Floatie, terrorizing several Ewoks including Shodu Warrick. Chief Chirpa leads the defense of the village. The Ewok warriors rally and some use a catapult to fire rocks at Raygar's floatie. However, Raygar uses his Floatie to destroy the catapult. Several Ewok warriors including Asha jump on his droids but they hurl them away easily.
Shaman Logray manages to destroy one of the recon droids with the Sunstar and tells the warriors to save the woklings. Three woklings including Malani run into the path of the second recon droid but Logray uses the Sunstar to disable it, causing it to fall over a bridge. Raygar resolves to get the Sunstar and fires a laser blast at Logray's balcony, causing the shaman to drop the artifact. Chief Chirpa and his warriors attempt to reclaim the Sunstar but Doctor Raygar uses his floatie's grappling arm to steal it. He then flies away. Chief Chirpa resolves to stop him.
Shortly later, Kneesaa lands with Raygar's freighter's pod in the heart of the village. She tells her father that Raygar is after the Sunstar. As Raygar's freighter flies away, Chirpa laments that the Sunstar is gone forever. Logray fears that Raygar could use the Sunstar for evil purposes. Wicket suggest there may be a way to retrieve the Sunstar and asks PD-38 if they could use his "canoe" to retrieve the artifact. PD-38 says this is possible.
When Chief Chirpa asks what is the ship, Wicket explains that it is a flying canoe and that they used it to escape from the "evil one." Shodu thinks the "canoe" is unsafe but Latara attempts to show everyone by jumping onto the controls. This causes the ship to rise into the air. Wicket, Teebo, Kneesaa and PD-38 managed to climb aboard but not the adults. Shodu and Chirpa watch from below with concern.
In the cockpit, Kneesaa tells Wicket that they should return to fetch the warriors. PD-38 warns the Ewoks that they have to follow Doctor Raygar's ship since it is fleeing into space fast. Wicket and Teebo agree they need to move fast. Kneesaa says that she is grateful that PD-28 helped them. PD-28 says that his first master taught him to always help others. Kneesaa finds a kindred spirit in the droid. Teebo asks where is his master. PD-28 says that he was stolen from his first master by the Empire but hopes to find him one day.
Latara notices that the console is beeping. PD-28 explains that they are heading into deep space and tells them to hang on. Soon, the Ewoks find themselves in space. Due to the zero gravity environment, they float through the cockpit. Wicket asks if this normal and the droid engages the gravity stabilizer.
Meanwhile, Dr Raygar returns to his Star Destroyer. Admiral Kazz asks if his mission was successful. Raygar says it was successful but tells the Admiral that he will only present the Sunstar to the Emperor. Admiral Kazz tells Dr Raygar that the Emperor is on his way but warns him that his trinket must be as powerful as he says. Dr Raygar is confident and vows to unleash the Sunstar's power on the galaxy.
As the computer beeps, PD-28 explains that they are approaching Dr Raygar's Star Destroyer. The Ewoks are awe struck by the vast size of the warship. Admiral Kazz contacts PD-28 over the intercom. PD-28 reports that he is reporting to serve Dr Raygar. Kazz tells him to approach the landing bay. PD-28 tells the Ewoks to hide and reassures them that everything will be alright.
After landing, PD-28 is captured by a recon droid and questioned by Admiral Kazz, who is skeptical of his story that he escaped the Ewoks and fled in the pod. Dismissing PD-28 as a failure for allowing himself to be captured, Kazz orders that the droid be recycled.
The recon droid takes PD-28. Watching his plight, Teebo and Kneesaa resolve to rescue him. Wicket propose that he and Kneesaa rescue PD-28 while Latara and Teebo search for Dr Raygar. They agree to meet at the pod. At the suggestion of Latara, the Ewoks disguise themselves as droids. Wicket is skeptical of her plan's chances of success but Latara says that this is the fastest plan she could come up with.
Latara avoids the notice of two stormtroopers but a friendly MSE-series droid takes an interest in Teebo. Latara grows jealous and the droid runs away. The two Ewoks enter Raygar's laboratory where the scientist is impressed with the Sunstar's power. Having studied the gem, Raygar realizes that by harnessing its power, he could remove Palpatine and install himself as Emperor.
When he notices Latara and Teebo, the two pose as buckethead droids but Raygar realizes they are intruders and uses the Sunstar to trap them in a pocket of energy. Raygar tells the Ewoks that he intends to create the mightiest weapon that the universe has ever seen. He then uses the Sunstar's power to create a dangerous cannon, which he intends to test on the Ewoks.
Meanwhile, PD-28 is loaded onto a conveyer belt by the recon droid, which laughs. However, Kneesaa and Wicket use a lasso to knock the recon droid onto the conveyer belt. The bullish droid is crushed into scrap metal by the machine. The two Ewoks then rescue PD-28 from being recycled. He then offers to lead them to Raygar's laboratory.
Back in Raygar's laboratory, Raygar tells Latara and Teebo that he intends to test the Sunstar–powered cannon on them before using it to destroy the Emperor. Raygar desires to use the Sunstar to make himself Emperor. Before Wicket and Kneesaa can stop him, Raygar fires Latara and Teebo into space inside a projectile. Raygar scatters Wicket and Kneesaa with a laser cannon. PD-28 tries to intervene but is hit by the laser and crashes against a wall.
Getting to his feet, Wicket charges at Raygar and lands on the Imperial scientist. As the two fight, Wicket triggers the cannon's controls, causing the weapon to power up and fire a blast. The blast damages one of the wings of the Emperor's shuttle but fails to destroy the craft. A bridge officer informs Admiral Kazz that someone on their ship fired upon the Emperor. The Admiral orders three stormtroopers to find the culprits.
Raygar grabs Wicket and vows to destroy him for ruining his plot to assassinate the Emperor. Kneesaa grabs the Sunstar and fires a blast at Raygar. Raygar fires at them but misses. Wicket destroys his blaster with the Sunstar's power. The Ewoks and PD-28 escape with the Sunstar to the landing bay to save Teebo and Latara. Before Raygar can stop them, he is confronted by three stormtroopers who hold him at gunpoint. Kneesaa flies the ship out and they rescue Latara and Teebo.
Meanwhile, Admiral Kazz arrests Raygar, charging him with high treason due to the attack on the Emperor's shuttle. Raygar wishes he had the Sunstar but Kazz does not believe him, claiming that his trip to Endor was a ruse for his treacherous plot. Raygar asks the Admiral what he will do with him. Kazz says that the Emperor is going to punish Raygar himself. After the Emperor's shuttle lands, two stormtroopers drag a frightened Raygar aboard the shuttle to meet the Emperor.
With PD-28's help, the Ewoks return safely to Bright Tree Village where the Ewoks celebrate the return of the Sunstar. PD-28 is happy that he could help the Ewoks get their Sunstar back. Wicket presents his belt of honor which is laden with several new enemy droid parts. Kneesaa is sad that PD-28 has to leave while Latara tells him that he will always have a home with them. PD-28 is grateful but says that his true place is with his master. PD-28 says he misses them, prompting Kneesaa and Latar to kiss him.
After PD-28 leaves in the escape pod to search for his old master, Latara accepts Kneesaa's lesson that if she helps others, they will help them in return. Kneesaa concurs.
When Latara and Teebo infiltrated Dr. Raygar's lab, they claimed to be "Buckethead droids" before Dr. Raygar says, "I no longer have any need for droids, especially when they're only... Ewoks in disguise!". This is the earliest on-screen use of a term that would become a common slang term for stormtroopers in Star Wars Canon.