Ashley Barnes was seen taking £122 of goods from Asda, on Old Mill Lane, in Forest Town, on March 17, and was stopped at the exit.
Chris Lacey, mitigating, said: “He had been collecting methadone without problems and he was taking a very low amount.
“But he missed appointments with his drug workers and the knock-on effect was to have his methadone prescription stopped.”
Mr Lacey said Barnes was told it would take six to eight weeks for the prescription to start again and he “reverted back to his old ways.”
He was now taking a 40 millilitre dose of the heroin substitute, whereas a few months ago, he was on 5 millilitres, Mr Lacey said.
Barnes, 33, of Eckington Walk, admitted theft when he appeared at Mansfield Magistrates Court, on Friday.
He was given a 12 month conditional discharge, and was ordered to pay a £20 government surcharge and £85 costs.