A father-of-two who jumped on a taxi and trashed it was "one of those people who goes crazy" when they drink, a judge said.
David Wright (34) jumped in the air and came down on the cab windscreen with his knees, causing more than €2,000 damage.
Judge David McHugh said he could avoid a four-month prison sentence if he is found suitable for 150 hours of community service.
Wright, an air-conditioning installer from Mill Park, Clondalkin, pleaded guilty to causing criminal damage to the taxi.
Blanchardstown District Court heard the incident happened in Orchard Road, Clondalkin, last October 7.
Garda Sergeant Maria Callaghan said the cabbie pulled in at 3.10am to pick up a fare when Wright approached and jumped on the bonnet.
He then leapt into the air and came down on the windscreen, smashing it with his knees and damaging the roof.
He rolled off the cab and walked away in the direction of Ninth Lock Road.
The driver followed him and identified him to gardai, who arrested Wright.
The court heard he had previous convictions for public order offences.
Judge McHugh remarked that it had been a "random attack".
Wright had been highly intoxicated at the time, his lawyer said. He did have a problem with alcohol but was dealing with that better now and drank very irregularly.
He had been grieving as his mother had died a few months previously.
The total cost of the damage and loss of earnings for the victim was €2,634 and he had that sum in court.
"This fellow has some form of alcohol problem, some form of something going on in his head," Judge McHugh said. "Give him some drink and he's one of those people that go crazy."
The judge did not accept bereavement was a factor.
Wright accepted that what happened was "100pc his fault", his lawyer said.
Judge McHugh adjourned the case for a community service report.