Stephen Kearns (50) had very little recollection of the events of the night due to his level of intoxication, his solicitor said.
Judge Gerard Jones imposed a six-month sentence, which he suspended for two years.
The defendant, of Barry Park in Finglas, admitted possession of a machete at Barry Drive, Finglas, on May 22, 2020.
Garda Ciaran Brennan told Blanchardstown District Court that he and two colleagues were called to Barry Drive at around 11pm following reports that a male was on drugs, was being violent toward his family and was threatening self-harm.
Gda Brennan said Kearns was in the front garden when he arrived at the scene, but then ran back into the house and went upstairs.
The garda said he followed Kearns into the house, as he was concerned for his safety.
There was no electricity and the house was fairly dark, he added.
The garda said he came up the stairs and he found Kearns facing him. The defendant was holding a hook machete, which he swung toward Gda Brennan’s head.
Gda Brennan said the machete was swung by the defendant less than a foot away from his face.
Gardaí retreated down the stairs and out of the house.
The Armed Support Unit had been called to the scene and they went into the house. They were forced to use a stun gun to restrain and arrest Kearns, Gda Brennan added.
The court also heard that Kearns had not been in trouble with gardaí in a long number of years.
Defence solicitor Valerie Buckley said the defendant’s brother had called gardaí, because his family was concerned about his welfare and they believed Kearns was a danger to himself.
Ms Buckley said Kearns had “very little recollection of the events of that night” such was her client’s high level of intoxication.
Ms Buckley said that Kearns, who was single and unemployed, had recently started attending a drama course.
She asked the judge to be as lenient as possible, saying Kearns had apologised to Gda Brennan for his behaviour, and he was more of a danger to himself than anyone else.