Police searched a Ballymena man and when they found a pipe in his pocket he said he used it to “sniff stuff”.
Kristan Millar (19), of Galgorm Road, appeared at Ballymena Magistrates Court on December 15 and admitted possessing cocaine and cannabis on August 6.
He told police he paid £100 for the cocaine.
Defence solicitor Stephen McCann said his client had sought treatment for his addiction.
The defendant was given a three months sentence, suspended for a year.