A probation officer addressed Preston Crown court on behalf of Lee Dennis Wilson-Carroll, 22, of Shaftesbury Avenue, Blackpool, describing how he had suffered PTSD after finding a friend who had taken his own life.
The court heard Wilson-Carroll himself had tried to take his own life, leaving him with injuries.
Prosecuting, David Clarke said at 4.15pm on June 29 police were called to Kaos on Queen Street to reports of a man causing issues
He added: "Staff had even expressed concerns he might be in possession of a knife.
"The defendant was completely cooperative and there was no knife.
"But in left trouser pocket a snap bag of white powder was found.
"In interview he explained he purchased it for £20 and that it was for personal use.
The find put him in breach of a conditional discharge for possessing a controlled drug - Class B., and he also has eight convictions for 12 offences.
The court heard he told the probation officer he was going to experiment with it.
He said he didn't go out but on that night had been convinced by friends.
He said he had a limited recollection as he was intoxicated, and hadn't been out since.
Defending, Julie Taylor said: " What is apparent is this is a young man who perhaps needs help."
Recorder Tania Griffiths imposed a six month community order with a rehabilitation activity, but warned sentences would get longer if he continued to offend.