An ice cream seller was punched in the chest and threatened with an iron bar by a man who was annoyed he was selling the sweet treats to young children.
John Green (24) had to be pulled away from the victim by his sister, who had told him to "cop on".
The ice cream seller ran away from his van after he was assaulted, but came back and was able to drive away.
Judge Anne Watkin ordered Green to enter into a probation bond for two years.
The defendant, of St Louise's Park in Blackrock, admitted before Dun Laoghaire District Court to charges of assault and possession of an iron bar.
The incident took place near his home in Blackrock on September 5, 2014.
Garda Mairead O'Sullivan said that the victim was selling ice-cream from his van when Green started verbally abusing him.
Gda O'Sullivan said Green was unhappy that the man was giving ice cream to young children.
She said the victim got out of his van to speak to the defendant and Green tried to punch him in the face, but missed. He then punched him in the chest.
Gda O'Sullivan said there was a building site next door to the housing estate and Green picked up an iron bar and started waving it at the victim.
The victim started to run away, leaving his van behind.
Gda O'Sullivan said Green's sister intervened and pulled him away, and the ice cream seller returned, got into his van and drove away.
Gardai said that the victim did not suffer any injuries during the assault.
The court heard that Green has 34 previous convictions, but has not been in trouble for a few years.
Defence solicitor Ronnie Lynam said Green has battled difficulties with cannabis and crack cocaine, and these would have been factors at the time of the assault.
Mr Lynam said Green recently attended St John of God's for substance abuse and suicide issues.
He is also attending psychiatric services and drug treatment services.
Ordering Green to enter into a probation bond for two years, the judge said she was giving him a "chance to get his life in order".