Two teenagers broke into a block of bedsits and attacked the residents leaving three men injured, Lincoln Crown Court was told.
The two 17-year-olds, together with an accomplice, kicked their way into the sheltered housing scheme on Ripon Street, Lincoln, and entered a room where the resident was punched in the face.
Andrew Peat, prosecuting, said “Thereafter one of the defendants picked up a baseball bat. He took that into a neighbouring room.
“A guest who was visiting the room was hit about the head five times. The resident of that room was hit to the head with the bat. Immediately his head began to bleed.
“During the incident there were threats issued. They were threats to kill.
“At one point one of the offenders picked up a knife in one of the rooms and nicked one of the victims on his arm.”
The intruders then made off with an x-box and mobile phones.
Police later found some of the stolen items during raids on the homes of the two boys.
The court was told that the incident happened less than a month after the two boys were each given referral orders for offences of affray.
The 17 year olds, both from Lincoln, each admitted burglary as a result of the incident on the evening of 2 July this year.
Each of them was given a 12 month detention and training order.
A third person involved in the offence has not been identified.
After the two boys were arrested one of them told police they had been drinking in a pub and he could not remember anything of what happened.
Mark Watson, for one of the boys, said “It is desperately sad. His a lost teenager without the maturity to cope.
“He can’t live with his mother because she can’t cope with him.”
He said the boy had mental health problems as well as issues with drugs and alcohol.
Sunil Khanna, for the other boy, said his client appeared to have been doing everything right since being given a referral order.
“Were it not for an argument with his girlfriend that day he would not have ended up seeing the other boy.”
He added “He has some psychological difficulties and problems with drug use. “