Malcolm Johnson, 52, attacked a customer at the club on East Parade and later returned carrying a machete and an air pistol on February 25.
A number of members of the public having a drink at the bar intervened and disarmed him, eventually managing to get him away and the victim to safety.
Johnson, of Dragon Parade, Harrogate, pleaded guilty to drink driving, possession of an imitation firearm, possession of a knife in a public place, affray and assault.
A York Crown Court judge jailed him for four years. The judge commended the patrons of the club for their bravery.
DC Rebecca Prentice, of North Yorkshire Police, said: “Members of the public displayed great courage in restraining Johnson, eventually managing to get him away and the victim to safety. They did this not knowing whether the gun was, in fact, real or not – putting themselves in potential danger to assist someone else.”