Dean Suddens-Burgess (21) had robbed a liquor store and thrust the weapon at a staff member immediately before the attack on February 8, and was later found unfit to stand trial.
The court heard earlier this week from Southern District Health Board consultant forensic psychiatrist Dr David Bathgate, who said the defendant presented a "significant risk" of violence in future.
The Dunedin District Court heard Suddens-Burgess had developed a fascination with weapons since being in Wakari Hospital and had been involved in four incidents of violence during his stay.
Judge Michael Turner yesterday ruled the defendant be detained as a "special patient" under the Criminal Procedure (Mentally Impaired Persons) Act.
He had been urged by defence counsel Brian Kilkelly to impose a less rigorous "compulsory treatment order", which could be reviewed after six months, but the judge said the more stringent approach was the only appropriate response to protect the public.
"Given the level of risk, the unpredictable and unprovoked nature of the defendant's violent outburst on this and earlier occasions, and his propensity for carrying weapons and violence, the defendant's release to the community should not be left to a single clinician," Judge Turner said.
A special patient's status could only change after serving half the maximum penalty for the crime they committed; and then it could only take place with sign off from the Minister of Health.
Aggravated robbery has a maximum term of 14 years.
Yesterday's ruling revealed for the first time the specifics of Suddens-Burgess's erratic, violent behaviour on the afternoon in question.
He entered the Princes St liquor store at 3pm and after walking the aisles for some time, selected beer, pre-mixed bourbon drinks and two packets of potato chips.
"After rifling through his pockets for some minutes, the defendant suddenly pulled out two scissor blades from the pockets of his jeans. He lunged towards the victim ... and narrowly missed stabbing him in the neck," the judge said.
Suddens-Burgess repeatedly yelled at the man not to call anyone or he would return.
In Bond St, police approached the defendant.
He put the alcohol down and immediately became hostile.
A female officer tried to wrestle Suddens-Burgess to the ground but he wriggled free and kicked her in the head and body as she lay there.
She pepper-sprayed her attacker but it had "no appreciable immediate effect".
As Sergeant Nathan White tried to contain him, the defendant pulled the scissor blades from his pocket and stabbed him in the face.
Suddens-Burgess advanced on the officer again and was only taken down after being tasered twice.
Sgt White required 15 stitches, Judge Turner said.
Suddens-Burgess was born and raised in Timaru but the court heard he no longer had any family support.