Starting second baseman Dustin Pedroia of the Red Sox had to withdraw as well because of a family emergency and will be replaced by the Rays' Carlos Pena. The slugging first baseman has also taken the final remaining spot in the State Farm Home Run Derby, to take place on Monday night at 7 CT.
Duke, the Pirates' ace, becomes Pittsburgh's first starting pitcher to make the All-Star team since Denny Neagle did so in 1995. The lefty, 8-8 with a 3.29 ERA, enters the break with three complete games, including one shutout. Duke was chosen after Cain was hit near his right elbow with a line drive on Saturday.
"It's icing on the cake, knowing all the work you put in, to have this kind of recognition," Duke said. "That's what it feels like, that you're being recognized for the work you've done across the league."
It will be the seventh All-Star appearance for Hoffman, who has 20 saves in 22 chances and is 1-1 with a 2.05 ERA. MLB's all-time saves leader with 573, the righty has 20 strikeouts and seven walks in 26 1/3 innings this year.
"It was a big surprise," Hoffman said. "It's nice to come in and have that kind of news get dropped on you. It's a big honor to be able to represent not only the Brewers, but the Brewers' bullpen and what they've accomplished in the first half. It's indicative of putting a guy like myself in position to go."
The left-handed-hitting Pena, who was one of five AL players on the 2009 All-Star Game Sprint Final Vote but lost out to the Tigers' Brandon Inge, was selected by his manager, Joe Maddon, who will lead the AL squad on Tuesday night.
Pena has 24 home runs and 58 RBIs but also 111 strikeouts and a .230 batting average.
"I was in a state of shock," Pena said. "I don't hesitate to say this is a miracle. For me, it's an obvious miracle, so I don't even hesitate to say that. I'm extremely grateful for this. Joe gets another opportunity to pick someone to come to the game, and he picks me. It means the world to me."
The field for the State Farm Home Run Derby now includes Pena, Inge, the Rangers' Nelson Cruz and the Twins' Joe Mauer in the AL. The four NL participants are first basemen -- Albert Pujols of the Cardinals, Ryan Howard of the Phillies, Prince Fielder of the Brewers and Adrian Gonzalez of the Padres.
The moves come a few days after Phillies outfielder Jayson Werth was added to the NL squad to replace injured Mets slugger Carlos Beltran and Cruz was picked to replace the Angels' Torii Hunter.