He sentenced him to eight months of home detention, 150 hours of community work, and ordered him to undertake psychological assistance.
Kearns, 23, was arrested in an armed raid in the east of Christchurch in November after police suspected he was dealing drugs.
He told police he had the gun because his mother, who is serving a life sentence for the murder of her second husband Phil Nisbet, had wanted him killed.
"My old lady is paying for a hit to be put on me," he said at his first court appearance.
The police summary of facts said Kearns was at his Southshore home with two friends on November 21 last year when they caught him selling drugs.
Kearns sold some marijuana to an associate who was stopped by police soon after leaving the address about 1.20pm.
Officers found him in possession of 11 large snaplock sandwich bags amounting to about 300g of dried cannabis.
Ten minutes later, a female associate walked out of Kearns' house and was found with 96g of cannabis leaf that she admitted buying from him for $1400.
Another man was caught buying a $20 "tinnie" about 1.50pm.
Kearns left the house with two females 10 minutes later and was swooped on by police.
A warrantless search of his house was conducted by police under the Search and Surveillance Act 2012.
A cut down single-barrelled sawn-off shotgun was found in a black backpack inside his wardrobe. Kearns is not the holder of a firearms licence.
Also in the wardrobe was a 20 litre plastic bucket containing nine snaplock bags of "good quality dried cannabis head" weighing about 249g.
A large supermarket bag was also in the bucket with a further 174g of similar-quality cannabis, which had not been packaged for sale.
In explanation, Kearns admitted joint custody of the firearm, stating he had it for his own safety. He owned up to selling the cannabis, the summary said.
In November, Kearns -- who testified against his mother in her murder trial last year -- won $55,000 from Milner after she framed him and put him behind bars.
Milner admitted perverting the course of justice and was jailed for two years and eight months when she sent herself death threats and claimed they were from her son.
Kearns was arrested and spent 18 days in custody, including his 19th birthday, while it is alleged that police took 13 days to carry out a search warrant which would eventually clear his name.
He has also launched legal action against police for allegedly failing to properly investigate his case.
Milner is currently serving a life term with a minimum non-parole period of 17 years for the murder of Mr Nisbet in 2009.
An appeal to the Supreme Court against her convictions was recently dismissed.
At sentencing, Kearns' lawyer Clare Hislop told Judge Saunders that Kearns was selling the drugs "to raise money to get out of Christchurch".
She said he had the unloaded gun for intimidation while selling drugs, and also as protection.
Police accepted a conversation took place informing Kearns of alleged threats, but could not take the matter further because there was a lack of credible witnesses.
Ms Hislop said his difficult and disturbing upbringing was well known, which has seen him become a victim, witness and defendant against his own mother, but he now had a supportive partner, family and employer to get his life back on track.
Judge Saunders told him he now had a chance to put his past behind him, and use the support he now has to build a better future.
The judge took Kearns' guilty plea and remorse into account in setting his sentence.