Ryan Todd had previously carried out work for the victim and knew him for a number of years and had on occasion been to his property, the court heard.
Todd, of Bentley Court, Westhoughton, had climbed over the gate on April 8, and after the victim asked what he wanted, he said he came to “return some ladders” and “needed a drink”.
After leaving the victim’s garden for a short period, the 32-year-old returned with a claw hammer, waving it at the victim, Bolton Crown Court heard.
Prosecutor Andrew McIntosh said: “The victim said he did not have any drink and to forget about the ladders.
“The defendant became agitated and refused to leave and he gave him some drink.
“He sat down for a bit and then left.
“Half an hour later the defendant returned with a claw hammer.
“The victim tried to calm the defendant down.”
The victim called the police and upon arrival Todd was seen climbing out of the rear first floor window on the garden shed, when he jumped off.
The court heard that Todd had forced entry into the victim’s property and when the property owner returned “there was a hole in the kitchen ceiling” due to insulation being pulled out.
Damage to the property was around £4,000, which included patio doors being smashed, a broken laptop, a scratched TV, and damage to two tables.
Todd had also cut the electric box above the front door and turned the gas hob on.
Mr McIntosh said: “It was the victim’s fear that had the electric been turned on there would be a risk of fire.
“He felt unable to stay in the property that evening.”
Todd was arrested and taken to custody, where he shouted racial slurs at a police officer, telling her to “go back to her country”.
Mr McIntosh added: “She treated the defendant with respect, but the defendant’s behaviour was intimidating, and she feared for her safety, and has great pride in her duty, and does not come to work to be abused.”
Judge Tom Gilbart said: “It is abhorrent you would use that language against anyone, let alone a police officer on the front line.”
Defence Martin Pizzey said that Mr Todd is sorry and has said he is “never gonna’ go on that stuff (drugs) again”.
He added: “He had been out of trouble for some time.
“Although there is a criminal history, he has been stable with regards work and accommodation.
“He would get daily pay and sometimes needed tools.
“Because he hadn’t returned a set of ladders promptly, he was refused work and he was upset by that and lost accommodation.
“This led to substance misuse and Class A drugs.
“Why he behaved in this way he does not excuse in any way shape or form.
“Since April his life has improved.
“He knows he will have to prove his worth and he is sorry.”
Todd was sentenced to two years imprisonment for criminal damage, affray, racially aggravated harassment, and burglary, and a 10-year restraining order protecting the victim was made.