Customers in a Dublin pub jeered and attacked a man who was carrying out a robbery with an imitation gun he had bought in a toy shop, a court has heard.
Anthony Burns, 43, has been jailed for a series of robberies, including one at The Villager pub in Chapelizod, Dublin on 12 December 2017.
Oisín Clarke BL, defending, told Dublin Circuit Criminal Court that during the incident customers in the pub jeered at him, telling him, "you're not going to do anything with a plastic gun".
Burns, a crack cocaine addict, took €520 of the pub's takings from barman Shay Donnelly but before he left, a customer hit him over the head with a bottle, the court heard.
Burns later received medical treatment for cuts to his head.
Mr Clarke said the customers were "robust" and carried out a citizens' arrest of Burns.
While being held down on the floor, one customer asked Burns "what are you doing?" and he replied "I'm a cocaine addict, I need money".
In his victim impact report, Mr Donnelly said he was relieved that neither he nor any of his customers were injured during the raid.
He said he had put the incident behind him and said he felt sorry for Burns.
Burns, of Rowlagh Gardens, Clondalkin, Dublin, pleaded guilty to robbery of the pub.
He also admitted robbery of cash from a Subway restaurant in Clondalkin and attempted robbery of Rapeedos take-away in Palmerstown on the same date.
The former security guard also admitted robbing €820 from a bookmakers shop in Clondalkin village on 5 December.
The victim in this case, Stacey Ryle, told the court that she felt threatened during the attack.
Katarzyna Filipiak, the victim of the Subway raid, told the court she feared she was going to be stabbed during the attack and was terrified for weeks after in work that another robbery would take place.
Judge Melanie Greally suspended the last two years of a five-year prison term after noting that Burns had shown an ability in the past to remain crime-free, and his last conviction was for offences in November 2000.
She said the crimes were amateurish in nature and seemed to be crimes of desperation.
Mr Clarke said that his client had become addicted to heroin at the age of 16 but later got work in security.
He lost his job when the company went bust in 2014 and began dabbling in cocaine.
Burns' previous convictions include false imprisonment, robbery and the unlawful seizure of a car in 2000.