Jordan Brown, 19, of no fixed abode, hurled bottles of booze at a shopkeeper as he stole cigarettes and alcohol worth Â£290 from his local store on Miller Road, Preston, on January 20.
But his mother walked in after spotting the worker, who she knew, leave his premises during the incident, Preston Crown Court was told. Half an hour later the goods were returned.
At an earlier court hearing relatives caused a disturbance, and only his mother and grandma were allowed to attend his sentencing.
Brown admits robbery, burglary and a bail offence.
Prosecuting, Paul Cummings said: “There was persistent and prolonged violence.”
While on bail for the robbery, Brown sneaked into the Royal Preston Hospital at 5am on April 23 and broke into the WH Smith shop, causing Â£700 damage and stealing Â£440 from the till.
Defending, Richard English said Brown had had a drink problem since the age of 16, could not read or write, and had a troubled education.
Judge Robert Altham said he accepted the robbery “occurred on the spur of the moment” but branded his second offence as “very mean spirited”.
He added: “You need to take stock of your life.”
Brown was sent to a Young Offender’s Institute for three years and two weeks.