Thomas Bates, 23, pulled out the knife when his next door neighbour challenged him - believing he had tried to enter his home uninvited.
Prosecutor Donna Fawcett told Chesterfield Magistrates Court during the public fracas in Belper, Bates said: “What are you going to do? I’ll shank you.”
Ms Fawcett told how Bates, standing behind an open window in his home, ”then pulled out a six to seven-inch blade”.
Police were called as the knife was produced.
Magistrates were told a November trial heard it was unclear whether Bates had been holding a kitchen knife or a potato peeler at the time of the incident on May 8.
However a bench of magistrates were convinced beyond reasonable doubt that a six-inch knife was produced.
Bates’ solicitor John Wilford told the court today (Thursday) his client had spent two months following the row in hospital receiving mental health treatment.
He said: “Two days after the incident he was sectioned at the Hartington Unit and was receiving treatment for psychosis.”
Mr Wilford added: “It was a very short incident - at no stage did Mr Bates attempt to leave his property.”
Bates, of John O'Gaunts Way, Belper, was found guilty of threatening behaviour.
He was handed a one-year community order with 12 rehabilitation activity days and 100 hours unpaid work, made to pay £350 court costs and a £95 victim surcharge.