A vigilant member of the public alerted police to a man trying to open car doors, Lynn magistrates heard on Wednesday.
Shane Eagle, 32, of Merchants Terrace, London Road, Lynn, admitted criminally interfering with three vehicles in Lynn the previous day.
Yvonne Neill, prosecuting, said Eagle targeted cars in North Everard Street and Valingers Road at lunchtime on Tuesday. A witness saw him looking into windows and trying the doors of two cars before walking away from the vehicles, Police were called and saw him trying a third car door.
Nothing was taken and no damage was caused to the vehicles, she said.
Giles Debenham, for Eagle, said his client had a deeply-entrenched heroin addiction.
He was doing his limited best to get to grips with his problems and was already subject to a community order with a drug-testing requirement.
Eagle had a poor record and had served a number of jail terms. Sending him to prison again would see him back in the community in 28 days, potentially homeless and with none of his problems solved.
The magistrates sentenced Eagle to a 12-month community order, including probation supervision, to run concurrently with his existing order.