Alan Knowles made the racially aggravated threats towards one officer at the hospital on April 29, and attacked two more officers as he was being taken to the hospital on September 10, Mansfield Magistrates’ Court heard.
Neither of the officers were injured in the second incident.
Knowles, aged 27, admitted making racially aggravated threats and two counts of assaulting an emergency worker.
Ian Pridham, mitigating, said Knowles, who appeared via video-link from HMP Nottingham, entered his guilty plea at the earliest opportunity.
He said Knowles suffers from mental health issues and was in ‘great emotional distress’ at the time of the offences, but a pre-sentence report ruled out a curfew or unpaid work.
Mr Pridham said: “He’s a young man who clearly needs help. He's had 80 days locked up in custody already.
“He’s desperate to get out in time for Christmas.
“He’s spent so long in custody because we have had to wait for this report to be prepared."
Knowles, of Yeoman Close, Worksop,was handed a 12-month community order with 15 rehabilitation activity requirement days.
He was also ordered to pay compensation.
Because racially aggravated sentences are uplifted, Knowles was told to pay a total of £600 to the three officers, but no victim surcharge or court costs were ordered.