Police responding to reports of a midnight disturbance in Bognor Regis found a bedroom filled with cannabis plants.
Officers knocked on the door of an address in Highfield Gardens on March 31 and Harry Martin answered the door, a court heard.
When he saw who it was he tried to stop the police getting in. It was soon clear why.
Martin, 23, appeared at Worthing Magistrates’ Court this morning and pleaded guilty to producing cannabis.
Prosecutor Gaynor Byng said: “When officers entered the premises the smell of cannabis became greater and they did find in one of the bedrooms a growing room containing 16 cannabis plants.
“Mr Martin told officers he was a heavy user of the drug cannabis. It became too expensive so he decided to grow it himself.”
The prosecution conceded that the plants – pictured in a photograph shown in court today – were intended only for personal use.
Defence solicitor Rachel Roberts said: “You have a defendant here who has no similar previous convictions and has pleaded guilty at the first opportunity.
“He has made full admissions.”
Chairman of the bench Stephen Ewins said: “Drugs offences are serious offences which the courts do not take lightly.”
He told Martin that the court took into account his lack of similar previous convictions and his guilty plea.
But he added: “However many plants there were you were quite serious about producing it.
“If you continue to use cannabis you will return to court. It will result in you losing your job, your friends, your family.
“Because that is what happens to drug addicts.”
Martin was given a community order and told to complete 60 hours of unpaid work.
He also must pay £85 costs and an £85 victim surcharge.