Joshua Slinger hit his victim in the face between four and six times, in the Vine Inn, on January 21, after exchanging “dirty looks” with him, said Daniel Pietryka, prosecuting.
In police interview, he apologised for what he had done and said it was “disgusting behaviour.”
Slinger, 19, of Kingsmead, admitted common assault at Mansfield Magistrates Court on Thursday.
The court heard he was given a community order for another alcohol-fuelled attack in Retford, in May 2016, by Nottinghamshire Magistrates Court.
He had been placed on Pubwatch and was barred from all but one pub in Retford.
Melanie Hoffman, mitigating, said Slinger was a “hardworking” young man, who worked 12 hours a day, six days a week, as a ground worker.
Magistrate Ann Coxall told him: “You could be facing custody. You can’t go around drinking and hitting people and getting away with it.
“You need to get away from the crowd you are mixed up with and learn to behave.
“You can’t let your temper lead you down this path. You will end up in prison.”
Slinger was given an 18 month community order, and must attend a 30 day programme to address his drinking and violent behaviour, with ten days of rehabilitation.
He was also given a 12 week curfew, from 9pm to 5am, from Friday to Sunday. He must also pay £200 compensation, with costs of £85 and a victim surcharge of £85.