Police caught a man hiding behind a pillar after he fled from a property while carrying drugs.
Jake Bostock of Alfred Teare Grove in Douglas appeared before magistrates at Douglas Courthouse.
The 25-year-old admitted possessing hundreds of pounds worth of cannabis and pregabalin tablets on May 14.
Bostock was ordered to do 50 hours community service and pay £125 costs.
Onchan's Manx signs won't wait for government advice
Farmer hits out after hay bale arson attack
Injured Manx S100 rider released from hospital
King praises Island's beauty during Tynwald address
Government public counters closed because of king's visit
Reduced MER service as Island braces for King's visit
Public Health issues advice on staying cool in heatwave