Shane Hulls, 27, admitted stealing the items, worth £20, from Wilkinsons, on Carolgate, on February 21, when he appeared at Mansfield Magistrates Court.
The court heard the theft put him in breach of a nine month community order, imposed in December 30, last year, and a conditional discharge, from February 8, this year, as well as a community protection notice banning him from shops in the town centre, all for shoplifting.
On Thursday, the court heard he was now making attempts to tackle his drug use and was now on a methadone prescription.
District judge Andrew Meachin told Hulls: “You clearly have an awful habit. We don’t expect drug abusers to snap their fingers and stop.
“But you have been given chance after chance to stop. The thing that stops you from going to prison today is that there seems to be a glimmer of hope that your drug rehabilitation just might help. You are now really on the edge.”
He revoked the community order and the conditional discharge, and gave Hulls 16 weeks in prison, suspended for 12 months, with five days of rehabilitation.
Hulls must also pay a £115 victim surcharge and £85 costs, which will be added to the £905 he already owes the court.