Rafal Krzysztof Magier (34), admitted assaulting a neighbour; assaulting three police officers; and possessing the drug Fentanyl.
He had his fists clinched and had moved towards the woman putting her in fear.
At a PSNI station the defendant told police he was a “very different person” with drink and drugs which made him violent.
A defence lawyer said Magier apologised for his behaviour and had shown “genuine remorse”.
At Ballymena Magistrates Court, District Judge Nigel Broderick said it had been a “very nasty” incident.
He said he normally sends people to prison if they spit at police.
The judge said the “saving grace” was the limited criminal record; the fact the defendant was in employment and that none of the spit had landed on the officers’ faces.
Judge Broderick told the defendant: “It’s a very nasty thing to spit at somebody, especially during a pandemic, because nobody knows whether you are infected with Covid-19 or not”.
Magier was ordered to do 180 hours of unpaid work and was also ordered to pay a total of £400 compensation to the woman and three police officers who were assaulted.