"His conduct in attacking the unfortunate victims was entirely driven by his underlying delusional beliefs that he was being followed by people from 'bikies' and his life was in imminent danger," Justice Lasry said.
Cardwell's delusion was of such strength to distort his moral reasoning and thinking to the point he thought he had no choice but to defend himself, he said.
But he could not reason about the wrongfulness of the conduct, Justice Lasry said.
He likely suffered a delusional disorder, schizophrenia or some kind of anti-social disorder, the court was told.
On the day he launched his violent assault, Cardwell was trying to defend himself from "people he thought would kill him", the court was told.
He later broke into a vacant house and stole a tomahawk before heading to the Rosebud Plaza, where he started beating an unknown male with the weapon.
"Morning, I finished that c**t," Cardwell told a shopper as he walked through the carpark.
He also smashed car windows and sprayed glass everywhere before he struck another man with the tomahawk and threw it in a garden.
One of his victims was left with a traumatic brain injury following the assault.
Cardwell is liable for supervision at a psychiatric facility but will remain in a prison until a report about the availability of services is provided.
Where to get help:
• Lifeline: 0800 543 354 (available 24/7)
• Suicide Crisis Helpline: 0508 828 865 (0508 TAUTOKO) (available 24/7)
• Youth services: (06) 3555 906
• Youthline: 0800 376 633
• Kidsline: 0800 543 754 (available 24/7)
• Whatsup: 0800 942 8787 (1pm to 11pm)
• Depression helpline: 0800 111 757 (available 24/7)
• Rainbow Youth: (09) 376 4155
• CASPER Suicide Prevention
If it is an emergency and you feel like you or someone else is at risk, call 111.