Gurvinder Toor, 27, allegedly attacked relative Taranjeet Singh outside his home, in Kempsey Close, Oldbury, on September 20, 2020, after hearing voices.
The defendant, who has mental health issues, is accused of attempting to murder the 32-year-old.
Giving evidence at Toor's trial at Wolverhampton Crown Court, investigating officer Detective Constable Narinder Sandhu said he interviewed the defendant the following day after he was checked by a psychiatric nurse.
Toor, of Latham Crescent, Tipton, was found to be fit to be interviewed.
Reading from his statement, DC Sandhu told the jury that Toor was known to be taking medication and had experienced an onset of schizophrenia in 2016 resulting in an incident where he had "smashed up" his house. He had been sectioned afterwards and was "now on medication".
The officer said during the interview he asked Toor: "Are you taking any medication?"
Toor replied: "Yes, but I forgot to take it."
Toor also said he had not taken one of the medicines, which he should have been taking for two weeks since the start of the month, for three days prior to the alleged stabbing. The defendant also stated in the interview that he had missed three doses of a monthly injection.
DC Sandhu said Toor replied that missing the three doses "affected" his mental health "leading to irregular thoughts".
The officer asked Toor: "Do you think you were hearing voices because you said you thought Taran was going to do something?
He said Toor replied: "Yes. I had thoughts when we were driving to Taran's house."
DC Sandhu said Toor stated that the victim had earlier remarked that "he was going to drop a bomb", but he told the officer that he did not know what Mr Singh meant by that comment and he was not a regular visitor to his home, in Kempsey Close.
The officer asked Toor: "At that time something told you he was going to hurt the kids?"
Toor replied: "Yes."
The officer said: "In that space of time?"
Toor replied: "He could have gone into his house and done something to his wife."
The officer said: "You didn't know what he meant. That was just your perception. In your mind you were protecting the kids because he said he was going to drop a bomb?"
Toor replied: "Yes."
Mr Singh, 32, suffered a total of nine wounds to his neck and arm during the incident which happened shortly before 8.20pm as the men returned from buying food from a takeaway.
Toor was sitting in the rear passenger seat when he allegedly carried out the attack.
During the hearing on Tuesday, the jury was told that the defence would not be presenting any evidence in the case and Toor would not be taking the witness stand.
Toor denies attempted murder.
The trial continues.