You choose which player or planeswalker is being attacked by the Boar token as it enters the battlefield. It doesn't have to be the same player or planeswalker that Carefree Swinemaster is attacking.

Artwork
Loading artwork…
Carefree Swinemaster
Commander Legends: Battle for Baldur's Gate · #219 · EN
Nonfoil—Foil—
Card rules
Whenever this creature attacks, you may pay 1
. If you do, create a 2/2 green Boar creature token that's tapped and attacking.
1/4
"C'mon, Boodigan, let's go see what kind of treasure this place has!"
Common · Illustrated by Michal Ivan
Format legality
Commander Legal
Duel Legal
Legacy Legal
Oathbreaker Legal
Pauper Legal
Pauper Commander Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Modern Not Legal
Old School Not Legal
Penny Not Legal
Pioneer Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
Although the token created is an attacking creature, it was never declared as an attacking creature. This means that abilities that trigger whenever a creature attacks won't trigger when it enters the battlefield attacking.
While resolving Carefree Swinemaster's triggered ability, you can't pay the cost multiple times to create more than one token.