James Manuel decided to rob a Whangarei superette with a plastic gun after losing his job and his car and a breakdown in a relationship.
But, it was Manuel who ended being the one under attack when the dairy owner fought back with a plastic stick.
The 29-year-old pleaded guilty in the Whangarei District Court to one charge of assault with intent to rob and another of threatening to kill.
He was sentenced to two years and 10 months in jail when he appeared for sentencing on Friday.
Reading from the police summary of facts, Judge Phillip Cooper said Manuel entered the Otangarei Superette on William Jones Dr about 6pm on June 12 this year wearing a hooded jacket.