A 23-year-old man planned a stabbing spree in York city centre, a court has heard.
Serial offender Jack Forest Cave told his probation officer that he was going to travel to a park on a “sunny day” and “stab lots of people”, York Crown Court was told.
The defendant allegedly said that he even went to a park in the city with a knife but left without attacking anyone because there were not enough people there.
Prosecutor Chris Moran told the court that a few days later, Cave also told his probation officer about another plan to stab a police officer to death.
In a text to the probation worker, he allegedly said: "I am just so angry. I want to go to prison."
Appearing in the dock this week, Cave was jailed for four years.
Watch: Man Jailed for life for murder of teenager Louise Smith
He pleaded guilty to threatening to kill the police officer as well as series of lesser charges including assaulting an officer and criminal damage.
The Recorder of York, Judge Sean Morris, said: "I will not take risks with the lives of the public and police officers in particular."
The judge added that although Cave had not stabbed anyone, he was not prepared to wait until he does “to pass the appropriate sentence to protect the public."
As well as the custodial prison sentence, the defendant must also serve a four year extended prison licence.
Defence barrister Neal Kutte said the defendant had been diagnosed with an emotional unstable personality disorder.
He said: "There is clearly a genuine medical problem that has led to this offending."
Watch: Four convicted of birthday party murders of two 17-year-olds