One day, while getting ready to leave for work, SpongeBob tells Gary that he had a bad dream the previous night and the latter conveys that he had a bad dream too, so SpongeBob tells Gary that he will play fetch.
After getting the stick, SpongeBob tells Gary to fetch his "favorite fetching stick." However, Gary brings back a chest. SpongeBob opens the chest only to find a series of consecutively smaller boxes. Eventually, he discovers a bottle which he opens and unwittingly releases the Flying Dutchman.
The Dutchman starts hypnotizing the citizens of Bikini Bottom to join his ghostly crew with an object of their desire, leaving SpongeBob to save them and defeat the Dutchman by himself.