The U.S.S. Enterprise must cross an empty sector of space on their way to deliver supplies to colony Beta VI. In this space, they find an uncharted planet whose presence can't be explained. After Kirk and Sulu disappear without apparent reason, Spock orders McCoy and geophysicist Lt. Karl Jaeger to the planet's surface to begin a search.
They find Trelane, a humanoid with tremendous psionic powers and a passion for Earth's 18th-century military history. It is he, they discover, who impulsively kidnapped Kirk and Sulu, wanting to add them to his arena of the Napoleonic era that he has created on this planet, Gothos.
While Trelane has great powers, he has little self-control and is spoiled, willful and impetuous. When McCoy and Jaeger appear, Trelane invites them all to join him at his party.
Spock manages to beam them aboard the U.S.S. Enterprise, but Trelane, determined to have his way in all matters, transports the entire bridge crew to Gothos for a banquet. Kirk challenges Trelane to a duel and in the process, destroys the device the alien uses to create his illusions. However, Trelane repairs it and prevents the U.S.S. Enterprise from leaving orbit until he can punish Kirk for his rash actions.
In exchange for freedom for the U.S.S. Enterprise and her crew, Kirk offers himself as the prey in a "fox hunt." Suddenly, as Trelane is about to kill the Captain, two noncorporeal beings appear. They explain to Kirk that they are Trelane's parents, and apologize for letting their child play such dangerous games. They then scold the errant child for his selfish behavior and temper tantrums. They inform Trelane that he will not be allowed to have another planet to play with until he learns how to treat other beings with respect.