Sheffield Crown Court was told how the incident took place when defendant, Desmond McFarlane, 41, went to use the toilet at The Bessemer in Leopold Street at around 8.30pm on March 27 this year.
Neil Coxon, prosecuting, said McFarlane's victim, who he knew because he was the ex-boyfriend of his former partner, came into the toilets a short time later.
He said: "Without any warning, McFarlane walked up to him, headbutted him and then punched him just under his right eye which caused him to fall to the floor.
"The assault carried on while he was on the floor."
Mr Coxon added: "It came to an end as quickly as it had started, and he [the victim] saw the defendant and two other males leave the toilet."
The man was taken to Northern General hospital to be treated for a broken nose, which did not require surgery.
In a victim impact statement read out in court, McFarlane's victim said: "This attack was unprovoked. My pride has suffered.
"I needed a week off work to recover and have lost £400 [in earnings]."
McFarlane, of Cotleigh Avenue, Hackenthorpe, pleaded guilty to one count of assault occasioning actual bodily harm at an earlier hearing.
Defending, Paul O'Shea, said: "He was in drink and let himself down extremely badly.
He added: "The injuries required, as far as I can tell, no medical intervention. The complainant removed himself from hospital."
Mr O'Shea told the court that McFarlane was a dedicated dad who had begun drinking heavily after losing his job, adding that he was now doing his best to manage his drink problem.
Recorder Jeremy Barnett sentenced McFarlane to 18 months in prison, suspended for two years, and was ordered to complete a 20-day alcohol rehabilitation requirement programme as well as 80 hours of unpaid work.
He was also ordered to pay his victim £400 in compensation.
Recorder Barnett told McFarlane: "You have come as close as it's possible to come to being locked up without leaving court through that back door"