Daniel Palmer told police he had HIV after breaching his anti-social behaviour order for the 47th time by biting a woman while drunk.
The woman had approached Palmer, 32, of no fixed address, outside the Home Guard Club in Abbots Road, Bury St Edmunds, to ask if he was all right.
Ipswich Crown Court was told on Friday that he responded by telling her: “I have been shot.”
Palmer, who was obviously drunk, then bit her on the arm, said Juliet Donovan,prosecuting.
While a 999 call was being made to the police, Palmer staggered off and was seen by a couple who were about to leave their home with their six month old baby.
Miss Donovan said the couple retreated indoors but when they came back out a short time later, Palmer was still present and repeatedly shouting: “Shoot me.”
The couple got into their car with the baby and locked the doors but Palmer sprawled over the bonnet in an apparent attempt to stop them driving off. As the car was reversed away, Palmer slid off onto the road.
When PC Luke Swain arrived at the scene, Palmer said to him: “I’ve got HIV and I’m going to spit at you,”
Miss Donovan said Palmer was taken to the West Suffolk Hospital for a check-up and while there had to be handcuffed and restrained with a spray when he began spitting and knocked over trolley.
Miss Donovan said Palmer had previously been arrested at Tayfen House in Tayfen Road, Bury St Edmunds after creating a disturbance in his room on December 29.
Staff at the hostel had heard smashing noises and Palmer saying: “In three seconds I’m going to stab you.”
Police were called and inside the room the floor was found to be strewn with items.
Palmer pleaded guilty to two offences of using threatening behaviour, one of assault causing actual bodily harm and one of being in breach of an ASBO imposed in 2007.
Defending, Ian James said that while Palmer had a long-standing alcohol problem and a poor record with the courts, he had shown recently that he was able to stay away from alcohol for several months.
Mr James added that Palmer, who had been drunk during the incidents needed help to address his problems.
Sentencing him to a total of 24 months imprisonment, Mr Recorder Martyn Levett told Palmer that an immediate prison sentence was the only realistic sentence.