A treasure hunt is a good way to keep the kids occupied while you get the cake or other food prepared. You can set it up outside or inside, depending on the weather and how much room you have. The children can play on teams or alone, depending on how many guests you have. If you do put them on teams, let the kids choose a team name based on some favorite pirate characters (Jack Sparrow, Blackbeard, etc.).
Hide a "treasure" somewhere on your property. Fill it with small gifts and trinkets. Then, write a series of notes on parchment paper. Each note contains a clue, which will send them to another location with another clue … and so on and so on, until the treasure is discovered!