Baillie Patrick from Birmingham pleaded guilty to robbery, possession of an offensive weapon and criminal damage at Birmingham Crown Court
The offences relate to an attack he carried out on a van driver in Shard End on 18 October last year.
Patrick claimed the driver owed him money and launched into a completely unprovoked attack during which he punched the 41-year-old and assaulted him with a sledgehammer.
He smashed up the Mercedes van too, causing hundreds of pounds worth of damage.
Patrick, who was drunk at the time of the incident, was arrested at the scene. While in custody he told police he had no memory what happened, but later admitted his guilt.