Daniel Wilson was found by officers in the car park of Asda, on Memorial Avenue, at 8pm, on September 6.
Wilson, 48, care of Radford Street, admitted breaching a criminal behaviour order banning him from the area, when he appeared at Mansfield Magistrates Court, on Friday.
Donna Pursglove, mitigating, said Wilson had previously been jailed after breaching anti-social behaviour orders, and was now on licence.
“He admitted he was a mamba user,” she said.
“The biggest issue is homelessness,” she said.
“He’s got nowhere to go. He went there because it was freezing cold and he wanted police to arrest him.”
Wilson was sentenced to 12 weeks in prison, and ordered to pay a £115 government surcharge.