A judge offered a man found with a knife a chance to avoid jail.
Cy Sedgman has been given numerous prison sentences in the last decade, Bristol Crown Court heard.
Having admitted having a knife, in April last year, he said he could do more time - but what he needed was help and support. Judge William Hart agreed.
Sedgman, 28, of Stapleton Road in Bristol, pleaded guilty to possessing a blade.
The judge handed him a five-month prison sentence suspended for 12 months.
He told Sedgman: "I don't need to tell you that people who carry knives commit a very serious offence.
"You've had nothing but prison sentences.
"I think there is benefit to try something different.
"If you don't take that opportunity you'll go straight to jail."
Sedgman was ordered to stay out of trouble, complete a six-month drug rehabilitation order and up to 25 days' rehabilitation.
Neil Treharne, prosecuting, said neighbours saw Sedgeman trying a door at flats in Charlton Boulevard, Patchway.
When he was challenged he was heard to say: "I'll stab you up" and kicked at a man's door.
Police called in found Sedgman near the Royal Mail building on the A38.
He admitted carrying a knife for his protection and shook a blade out of his trousers.
He told officers: "I've never used a knife and never would."
John Stokes, defending, said: "He's gone back into custody over the last few days.
"He doesn't want to go back there."