Brad Birch, 23, robbed an acquaintance of his in an unprovoked attack, holding a knife to his throat for a few pounds.
When a bystander tried to intervene, Birch punched him in the face, breaking his glasses.
Months previously, Birch had terrorised an ex-partner of his after learning of her new relationship. Birch went to her Market Drayton home six times that day, shouting threats through her letterbox and banging on her window.
When she agreed to go outside and speak to him, he grabbed her and wrestled her phone from her before running away.
Birch was sentenced for the two incidents at Shrewsbury Crown Court this week, facing charges of robbery, harassment and assault. He was also prosecuted for sending letters to the ex-partner in breach of a restraining order.
Ms Katie Fox, prosecuting, told the court that on the afternoon of October 13 last year Birch went to the home of his ex-partner. The two had recently separated.
He began shouting at her about another man, the court heard. She went inside and locked the door.
He came back to the house five times over the next 10 hours or so, threatening to "knock her out" and throwing things at the house.
On one of the occasions he stole her phone and ran off. On another he hit a window hard enough to crack the glass.
Birch was arrested and interviewed later that month, and has now been prosecuted for harassment and battery.
In impact statements, his victim said that his actions made her feel "on edge" and afraid of what he might do.
In May of this year, Birch approached three men who were talking in Market Drayton.
One man greeted him and in response Birch punched him in the face, breaking one of his false teeth.
That man was able to cycle away but Birch turned his attention to one of the others. He pulled a knife from his pocket and held it to the man's neck, demanding "whatever you've got on you".
The man had a few pound coins on his person so threw them down.
A man who was in his parked car nearby heard what was happening so came over to intervene, and Birch hit him in the face hard enough to break his glasses.
Birch ran off and was caught by police later that day.
Two of the victims gave statements saying that Birch appeared to be "on something" when he attacked them. One of them said that until the attack he considered Birch a friend.
At court this week, Birch, of no fixed address, was represented by Mr Paul Smith.
He said that the defendant has been seeking help for his mental health issues including drink and drug problems.
Judge Peter Barrie said that having "time to think" should benefit Birch.
He handed down a sentence of four years for the robbery in May, as well as shorter concurrent sentences for assault causing actual bodily harm and common assault.
The sentence for harassing and taking the phone from the ex-partner last October was one of five months to run consecutively, meaning a total sentence of four years and five months.
For breaking the restraining order he received a concurrent sentence of two months.
The judge also imposed a new restraining order for the ex-partner, to last five years.