From the Super Mario Wiki
When players decide to stop here, they meet Hammer Bro., who is practicing his hammer throwing. His quest, Hammerama, involves players in a little game with him. All they must do is throw their hammer farther than Hammer Bro. to win. Doing this rewards them with the Gaddget, Mini B-Ball.