Doctor Raygar, a scientist for Emperor Palpatine, has designs on ruling the Galactic Empire and travels to the Forest Moon of Endor to obtain the powerful Sunstar from the Ewoks' Bright Tree Village. He is attacked by the shaman Logray, who uses the Sunstar against him, but Raygar's Imperial Reconnaissance Droids soon overwhelm the village and the doctor swiftly steals the Sunstar, returning with it to Admiral Kazz's Star Destroyer in orbit.
Back in his lab, Raygar begins studying the Sunstar and realizes that by harnessing its power, he could remove Palpatine and install himself as the Galactic Emperor. But when creating a dangerous cannon with the Sunstar's powers, Raygar discovers that Wicket, Kneesaa, Latara and Teebo have come aboard Kazz's Star Destroyer with the help of a pilot droid named PD-28. Raygar plans to test his weapon on the captive Latara and Teebo, but is thwarted by Wicket. Inadvertently, Raygar fires upon the Emperor's approaching shuttle instead. Palpatine survives, and Admiral Kazz subsequently arrests Raygar, charging him with high treason. The Emperor then oversees the doctor's punishment personally. With PD-28, the Ewoks return safely to the Forest Moon of Endor, where Wicket, Kneesaa, Latara and Teebo say good-bye to the pilot droid as he embarks on a search for his old master.