A Kirkby man was carrying two knives when he kicked out at police officers, a court heard.
Police were called to Gladstone Street when Billy Gibson's wife raised the alarm, after he threatened to kill himself, on the afternoon of September 30.
Gibson emerged from his works van with a kitchen knife and a lock knife in the pockets of his fleece, and charged at one of the three officers, said prosecutor Robert Carr.
He was taken to the floor, where he struggled while officers tried to apply their handcuffs, and when he was on his feet again, he kicked a WPC and a PC in their knees.
Abbie Edwards, mitigating, said: "His only intention was to harm himself. He didn't want them preventing him from going through with what he intended to do.
"At no point did he brandish the knives or threaten anyone. He has been struggling severely with mental health issues."
She said the self-employed landscape gardener stored the knives in his works van, and his wife called the police when he went to get them.
But she added that he had made "positive changes to his life" since the arrest, and was in a "much better situation" today.
Gibson, 35, of Gladstone Street, admitted two counts of assault, possessing the blades, and using threatening behaviour, when he apeared at Mansfield Magistrates Court, on Thursday.
A 12 month community order, with 10 rehabilitation days and 80 hours of unpaid work, was imposed.
He was ordered to pay £100 compensation to the WPC and £50 to the PC.
You can read more of the latest cases from Mansfield here.