McDonald said that was not true.
On the day of the shooting, police found McDoanld's three bedroom home in east Auckland had been rigged with security cameras and sensor beams guarding the driveway.
Inside, McDonald had stashed money, drugs and computer equipment in three different safes. He had also bought a high-powered air rifle to scare away robbers.
The self-proclaimed "mid-level dealer'' had been in the methamphetamine scene for 10 years but said he was planning to get out.
He told the court that he was not "primarily'' a drug dealer but instead made his money from cracking codes on stolen laptops and cellphones.
"It was known I could get things, whatever anyone wanted, and sometimes I was paid handsomely for it.
He shared the home with his cat Tigger and Mr Kahi who was moving out on the day of the shooting.
McDonald said Mr Kahi broke into the house on the evening of July 4 and threatened to kill him before throwing him onto the lounge floor.
McDonald said his adrenalin was pumping. "I just grabbed this bloody thing,'' referring to his air rifle on the evidence desk in front of him.
Mr Dixon asked if shooting Mr Kahi was "excessive''.
McDonald answered: "In hindsight, yeah but at the time I was on my back.''
He described firing the gun in an arc as he lay on the floor.
Mr Dixon said: "You shoot not everywhere, not anywhere but exactly at Keith Kahi and you hit him repeatedly.''
Mr Kahi was hit by seven of the pellets but McDonald denied he was aiming the gun.
Earlier McDonald told the court how the gun had ended up on the floor of his lounge, after he had sat on his couch with the rifle and contemplated suicide.
"The two events are not connected. If I had gone through and done the suicide, Keith would still be here and I would not.''
He said his cat jumped onto his lap and he put the gun down before resting on his bed.
Mr Dixon asked why, days after the shooting, McDonald had told police there was no explanation for the shooting and yet now he was telling the court that he had acted in self-defence.
McDonald said: "There is no explanation, I still don't know why it happened. It shouldn't have happened.''
The prosecution and defence are due to sum up on Monday.