Bowser Jr.'s Mighty Megahammer
Cross the vanishing blocks to the next platform where you'll need avoid the Bullet Bills and the Fizzlits when they turn into electrified yellow puddles. Cross to the left and beak open the egg to ride Yoshi. Yoshi can eat the Bullet Bills and spit them back out in the direction you're facing. Grab a Bullet Bill and jump up onto the higher platform and shoot the Bullet Bill at the big glass sphere in front of you to break it. Proceed forward and cross to the next platform, using the vanishing blocks if you need to and avoiding two more Fizzlits up there. Make sure if you're going to have Yoshi eat them that they're not starting to turn electric. Get on the platform and hit the blue switch on the side with Yoshi's tongue to start the platform moving to the right.
On the platform you'll have to avoid the mines floating above it and the Bullet Bills being fired at you from the Undergrunt Gunners in the distance. These Bullet Bills will home in on you, so make sure to grab them up and fire them back at the cannons. The last two mines are directly in your path, so you might want use a Bullet Bill on them instead of trying to jump and flutter over them or squeeze by on one of the sides. When the platform stops, go to the right and hit another switch guarded by a Fizzlit to start the next ramp. Stay on the right edge of the ramp to avoid the mines and destroy the flying cannon when it shoots a Bullet Bill at you. Grab another Bullet Bill after that to destroy the glass sphere ahead, then avoid or eat any other Bullet Bills until you can use the mini Launch Star at the end.
In the next section, hit the checkpoint then make your way over to the switch under the glass cage. You can either run across the cannons and deal with the Hammer Bro. on the other side, or just jump and flutter to the left, following the path of the Bullet Bills. Either way, grab a Bullet Bill with Yoshi and jump up on the platform with the switch so you can break the cage. Board the striped platform and hit the switch to continue on. As you cross this next area, two pirate ships will block your path, forcing you to jump on them and jump back on the platform on the other side after it passes through. Don't worry about taking to long on a ship, as new platforms continuously flow along the path. In between the two ships is a Life Mushroom surrounded by mines and on the second ship is a Hammer Bro. and the Comet Medal. After the ships, use one of the Bullet Bills to break the glass cage and avoid the rest. Eventually you can jump off and hit a checkpoint by the Shop Luma before launching to the boss fight.
For this fight, Bowser Jr. is inside his huge robot Megahammer, named after the two large hammers attacked to either arm. This fight takes place on a circular platform with Yoshi nests and mini Launch Stars that allow you jump across to the other side. The goal for this fight is to use the Bullet Bills that are launched at you to break the three blue spheres on Megahammer, then destroy the cage on top where Boswer Jr. is. They each take two hits and you'll need to hit them when they're on the side facing you and Megahammer isn't blocking you.
Start off by grabbing the first Bullet Bill that comes your way and sending into one of the blue spheres on his chest, then grab the other Bullet Bill. When you hurt him, Megahammer will pull his hammers up to guard himself, so wait until he drops them before shooting your Bullet Bill again. Sometimes he will smash the Bullet Bills you shoot at him by clapping his hammers together, so just repeat the pattern of grabbing the missiles he sends to you and waiting for an opening to shoot. If you wait too long, you'll experience his attack, which consists of slamming both hammers down on the ground on either side of you, causing red shockwave rings to expand outwards toward you, shooting Bullet Bills and a huge Banzai Bill out of the center of his chest. Stay in the middle of his hammers and jump and flutter when the rings get to you, and use a Bullet Bill to break the Banzai Bill if you have to.
When you've broken the two spheres on his chest, run to the side until you find a mini Launch Star. Grab a Bullet Bill and launch yourself to the other side to score a quick hit against the sphere on his back. When you're behind him and he does is double hammer slam attack, you'll see that he shoots a bunch of Bullet Bills out of his back and it looks like one big shockwave ring is coming at you. Avoid the ring the same way by jumping and fluttering, then start grabbing Bullet Bills and shooting them while avoiding the others. If you time grabbing a Bullet Bill and launching to fire it correctly, you'll keep hitting him before his attack gets to you. After you hit him in the back he'll turn around to face you again, so just grab another Bullet Bill and launch to get your second hit from behind.
When all the blue spheres are broken, Megahammer goes into his final phase which is launching Bullet Bills at you and doing two hammer slams. All you have to do is grab and shoot away the first Bullet Bill, then grab the second and jump over his shockwaves from the slams. On you second jump, shoot the Bullet Bill into his head at the top of your flutter. Simply do this twice and you'll destroy the robot to reveal the Grand Star. Use any of the mini Launch Stars on the platform to launch up to it.
Megahammer's Daredevil Bash (Prankster Comet)
For this star, you have to repeat the Megahammer boss fight from the previous star, but with only one hit point. As long as you get your attacks off right away so you don't have to dodge his, you should be fine.
After hitting a switch to move the platform for the second time, stay on the right side of the platform to avoid the mines and send destroy the Undergrunt Gunner on the right with the Bullet Bill he shoots at you. This will reveal the Green Star hiding behind his flying cannon. After flipping a switch for the third time, you'll ride a platform forward and have to cross two ships. On the second one that has the Hammer Bro. on it, go to the front of the ship and walk out to the tip of the post hanging off the ship. At the end jump and flutter with Yoshi to grab the star. Keep your eye on the background while you do this, as the Bullet Bills can reach you this far out and they'll knock your right off if you're not careful.