A man broke his friend's nose after being told off for exposing himself to a woman at a Bonfire Night party.
Robert Nichol was ordered to pay £1,500 compensation to his victim over the drunken attack at the house in Normanton, near Wakefield.
Leeds Crown Court heard Nichol, 36, turned violent when the victim told him to behave after he exposed himself to a guest.
Paul Canfield, prosecuting, said Nichol and his partner hosted the fireworks party at their home on November 10 last year.
The victim is a former colleague and close friend of Nichol's and attended the party with his children.
He spent the evening drinking cider, shots of Sumbuca and cocktails which Nichol and prepared.
The incident happened at the end of the night when the children had fallen asleep inside the house and Nichol's wife had locked up and gone to bed.
Nichol and the victim were in the outside bar area talking to a female guest.
The prosecutor said Nichol pulled his trousers down, exposed himself and made a lewd suggestion to the woman.
The woman shouted and screamed at Nichol before leaving.
Mr Canfield said the victim was also shocked and told Nichol to "put it away."
Nichol then walked up to his friend and punched him in the face, saying: "No one has ever got my back."
The victim tried to calm Nichol down but he attacked him again outside his house.
He was knocked to the ground and kicked to the face repeatedly by Nichol.
The victim suffered a fractured nose, broken teeth, black eyes and swelling to his face.
Nichol, now of Parkgate Avenue, Eastmoor, Wakefield, pleaded guilty to assault occasioning actual bodily harm.
A probation officer told the court Nichol could not remember what had happened because he had been so drunk.
Nichol was given a 12-month prison sentence, suspended for two years.
He was also ordered to do 100 hours of unpaid work and pay compensation to the victim.
Judge Tom Bayliss, QC, said: "It really was quite appalling behaviour.
"You thoroughly deserve to go to prison. The only thing that saves you is that you pleaded guilty.
"You should consider yourself lucky."