Judge Singh noted that Lovich had been in custody since the day he was arrested – for four months and one week.
Lovich was supported by his mother, sister and brother in the court's public gallery.
Judge Singh sought an assurance from them that no gang members lived at the proposed home detention address in Flaxmere, and that none would visit.
They assured the judge that this was the case.
Judge Singh also asked Lovich about his gang associations and Lovich answered: "It's over. It's finished."
On the methamphetamine dealing charge, Judge Singh sentenced Lovich to home detention for seven months.
He received three months of home detention to be served concurrently on the cannabis charge, and nine months of post-detention conditions, which included a condition not to associate with members of the Mongrel Mob.
Other conditions included to undergo an alcohol and drugs assessment, and do any counselling recommended by that assessment, not to use or consume alcohol or non-prescribed drugs, and to attend an assessment for a Department of Corrections rehabilitation programme.
Counsel James Bridgman appeared for the Crown and Hagen Neumegen for the defence.
Neumegen said that Lovich was committed and motivated to attend rehabilitation.
In deciding the sentence, Judge Singh took into account a range of factors including the time Lovich had spent in custody, his guilty pleas, and a cultural report that detailed his drug addiction and deprived background.
"In the fullness of time, with the assistance of the home detention team, you may be able to take appropriate rehabilitation for your drug addiction," the judge said.
But he also told the court: "Should he stuff up his home detention, he is likely to end up in custody."
Lovich was ordered to forfeit $2705 found in his possession when he was arrested.
Lovich had a previous conviction, in 2019, for possessing 23.63g of methamphetamine for supply. At that time, case law determined more severe sentences and he was sent to jail for two years and seven months.