Ryan McCoshan struck 63-year-old Peter Brown with the weapon, which had a 26-inch blade, outside the house he lived in with his grandmother at Dumbarton, West Dunbartonshire.
The sword sliced into a bone in Mr Brown's arm and he was so badly injured he needed a blood transfusion and surgery. McCoshan hid in the loft from police officers who were called to the house in Ashton View in the aftermath of the incident which broke out following a row over a delivery.
McCoshan, 26, admitted assaulting Mr Brown to his permanent disfigurement and impairment.
Judge Lady Rae told McCoshan that, but for his early plea of guilty, she would have jailed him for six years. The court was told Mr Brown has been unable to work since the incident last September.