Former Ireland international Paul McGrath has agreed to give a day's coaching to young people at Tullamore Town FC after admitting to public order charges at Tullamore District Court.
The footballer was charged with intoxication and threatening and abusive behaviour, arising from an incident at the Tullamore Court Hotel in Co Offaly on 29 June.
Inspector John Lawless said: "Gardaí were called to the Tullamore Court Hotel at 3.10am" on the morning in question.
"He was drunk and attempted to get into two parked cars," he explained.
When gardaí approached, McGrath was "shouting in a disturbed manner and appeared aggressive", he added.
Solicitor Donal Farrelly said his client was pleading guilty to the offences, which had occurred after a wedding at another location.
He described McGrath as "one of the greatest footballers Ireland ever had".
"Unfortunately Paul suffers from a debilitating disorder called social phobia," explained Mr Farrelly.
"He suffers from acute anxiety ... to deal with that anxiety he sometimes turns to drink," he said.
The court heard the separated father-of-six, who is normally accompanied at events by an agent or friend, attended the wedding on his own and had been offered alcohol.
Mr Farrelly said his client has handed in a letter of apology to the gardaí and staff at the hotel.
He remains deeply embarrassed and has no recollection of the event, Mr Farrelly remarked.
Judge Alan Mitchell noted McGrath is a "national hero" and he asked whether he might be prepared to coach some children local.
He agreed to deal with the matter under the probation act if McGrath was willing to coach local young people for a day.
McGrath, who has an address at Tomsallagh, Ferns in Co Wexford, responded: "Yeah, I'll do it, no problem."
He signed autographs and spoke with gardaí before leaving the courthouse.
Judge Mitchell told McGrath: "You were in Tullamore for a wedding you will be coming back now to help young people."
McGrath has six months in which to carry out the day's football coaching.