Reihana, armed with a loaded firearm, and another male, with a screwdriver, rushed through the front doors of the tavern about 11.50pm where there were up to 10 patrons and two staff members.
"There is only one purpose for a firearm like that and that is criminal," the judge said.
Reihana then pointed the gun at a staff member and demanded he open the safe.
"He went to the safe with you brandishing the firearm. He must have been absolutely terrified," Judge Orchard said.
The safe was opened and Reihana grabbed some till drawers. He jumped up on the bar and was waving the firearm around at patrons.
It was at this point that some of the patrons disarmed Reihana. In the struggle the shotgun was fired and narrowly missed the head of one of the patrons. The shot hit the tavern floor instead.
While Reihana was restrained until police arrived the second person ran off but not before stabbing a staff member in the neck, below his left ear, as he tried to stop the offender leaving.
In victim impact statements the two bar staff, aged 25 and 35, said the robbery was extremely stressful and had made them anxious every time they turned up for work that something similar could happen again.
Judge Orchard said that after reading a cultural report detailing Reihana's background it illustrated his childhood which she described as an "extraordinary disadvantageous upbringing".
He was kept out of school for three years, from 7 to 10, by his father when his parents separated.
When he returned Reihana found it difficult to reintegrate and going barefooted and in tattered clothes made it very difficult.
"You were a little boy who did not have support at home or a loving environment. It's not at all surprising where your path led you."
Reihana was subjected to serious beatings from his father, a gang member, growing up. He was also exposed to drugs and started smoking cannabis at age 12 and later became a methamphetamine user.
When spoken to by Judge Orchard Reihana eloquently explained he had achieved NCEA level 2 for English over the periods he had spent in youth custody but maths was a problem.
However, the robbery was extremely serious and Reihana had taken a loaded firearm to a business where there were members of the public.
Judge Orchard also said Reihana had previously had plenty of opportunities to change his life but had not taken them up.
"Your children do need you and they need someone who can model good things."