Officers raided Ben Jordan's home in Ash-Lea Drive, Donnington, Telford, on November 26 last year.
The 21-year-old directed police to the box containing drugs on top of the fridge in his kitchen.
Police found 25 grams of crack cocaine which, with an estimated street value of £40 to £60 per gram, was worth around £1,200.
At Shrewsbury Crown Court on Tuesday, prosecutor Mr Ravi Sidhu said police also found a small amount of heroin, scales, £735 in cash and a couple of mobile phones "containing messages advertising the supply of Class A drugs".
Jordan pleaded guilty to a charge of supplying Class A drugs at a hearing in January.
Mr Robert Edwards, defending, said: "He does not shy away from punishment.
"He is a young man who is still to find his stride in life - he does not have a trade or a settled job and until these proceedings was working in a factory.
"His aim is to work with his uncle who has a plastering business.
"He has already made plans on how to spend his time in custody - he hopes to find where his trade lies.
"He is not a man who is going to sit idly in his cell - he knows this is a day of reckoning.
"To quote him 'this has been a wake-up call'."
Judge Peter Barrie sentenced Jordan to three years in prison and imposed a two-week prison term for possession of heroin to run concurrently.
Half of the sentence will be served in custody, the other half on licence.
Judge Barrie ordered the drugs, paraphernalia and mobile phones be destroyed and Jordan forfeit the £735 that was seized.
Addressing Jordan he said: "When police raided your home they found a substantial amount of crack cocaine and acknowledged you were selling it on the street.
"There is no reason to think you were put under pressure to engage in this.
"You were dealing direct to users.
"The only mitigation is you had the good sense to enter a plea of guilty."