Jacob Fores was drunk when he went into Asda and stole Olay anti-wrinkle cream, on August 6.
Rebecca Williams, mitigating, said Fores blamed himself after his best friend was stabbed and killed last year.
Another friend died of hypothermia after falling into a canal, and a third pal was killed by a drunk driver in Creswell, she said.
"Following all these incidents he has found it very difficult to cope and has tried to use drink or drugs to numb his feelings," Ms Williams said.
"He turned to mamba."
The court heard he is due to be sentenced for assault occasioning actual bodily harm at Nottingham Crown Court, on September 4.
Fores, 20, of Sherwood Road, admitted the theft and breaching a criminal behaviour order, when he appeared at Mansfield Magistrates Court, on Wednesday.
Sentencing was adjourned until September 11, for an update from the probation service.
Click here for more Mansfield crime stories.