A frightened householder called the gardai after finding a trespasser "out of his mind with drink" and carrying a pole in his front garden.
Officers discovered that Anthony Maguire (37), who has significant mobility issues following a serious motorbike accident, had been using the pole as a crutch in order to get "from A to B".
He had gone into the man's garden to ask for a glass of water as he walked home after an all-night drinking session, Blanchardstown District Court was told.
Maguire, of St Mark's Grove, Clondalkin, pleaded guilty to trespassing in a manner likely to cause fear.
The incident happened at Convent Road, Clondalkin, last September 27.
Gardai were called to the house and found the accused in the front garden at 10.35am.
He was holding a pole and had no lawful reason to be there.
Maguire had previous convictions for offences including theft, the court heard.
The accused had needed hip and knee replacements following a motorcycle accident and still needed surgery on his knee which was infected and may require amputation, his barrister Ciaran MacLoughlin said.
The night before the incident, Maguire had been drinking at his girlfriend's house and he was using the pole as a crutch, the barrister added.
There was a man in the house, and Maguire went to ask for a glass of water. Because of his intoxication, the man called gardai.
The court was told Maguire had been a chronic drug user since the age of 13 and had taken "copious amounts" of crack cocaine during his life.
He had been trying to address that issue and was waiting to go into a treatment programme.
Maguire's girlfriend is now pregnant with their first child. This has had a significant positive impact on Maguire's behaviour, and he realised he could no longer take illicit substances, Mr MacLoughlin said.
Judge Paula Murphy adjourned the case for reports and said she would impose a three-month suspended sentence if Maguire was found suitable for probationary supervision.