Welcome to BYC!
There are different schools of thought when it comes to a rooster showing aggression - some that address rehabilitation and others that address removal. There are a few things that may factor into which approach would be appropriate for your situation. What breed is your bird? How long has the aggression been going on? What have you done in response thus far? Do you enter the coop at other times without getting a response or is egg gathering the only time you go into the coop so that is why you associate that as the stimulus that results in the attack?