I believe that they had to happen or He is a false prophet.
Deuteronomy 18:22 says, “If what a prophet proclaims in the name of the Lord does not take place or come true, that is a message the Lord has not spoken. That prophet has spoken presumptuously. Do not be afraid of him.”
However just because judgment is prophesied, doesn't mean that it has to happen. We see that in the book of Jonah. But that is conditional based on repentance.
The two sentences I have reddened appear contradictory to me.
However, you may mean that if the prophecy is given as a conditional prophecy, it won't come true if the condition isn't met. This was
not the case with Jonah.
Yahweh did not speak a conditional prophecy through Jonah, such as "Unless you repent, Ninevah will be destroyed in 40 days." Rather he spoke and unconditional prophecy through Jonah, "Yet 40 days and Ninevah will be destroyed."
Now just in case you say that this prophecy was meant to be conditional even if not specifically stated, but that the conditional clause was understood, I will quote the statement stated which indicates that this was not the case.
When God saw what they did, how they turned from their evil ways, God changed his mind about the calamity that he had said he would bring upon them; and he did not do it. Jonah 3:10 NRSV {bolding mine}
I looked up the word translated "changed his mind" in the Greek Septuagint translation. The appropriate tense and person of the Greek word "metanoueō" is used. This word means "to have a change of mind". So God could have a change of mind only if he had actually intended to destroy Ninevah. If the prophecy were conditional, then he didn't have a change of mind at all. If the prophecy had meant, "Unless you repent, I will destroy Ninevah in 40 days", then God didn't change his mind. He acted according to his original intention.
It won't do to appeal to the Hebrew Masoretic text, the basis for the Hebrew Old Testament, a text from over 12 centuries later. For in that text, the Hebrew word is "nacham" which any Hebrew lexicon will tell you means "to be sorry, to regret". Unless God has acted contrary to his original intention, he would have no regret.
Conclusion: Because the Ninevites repented, God did do what he said he would do; he did not act in accordance with his original intention to destroy Ninevah. Therefore his absolute prophecy through Jonah ("Yet 40 days and Ninvah will be destroyed) did not come true.
And according to you, that makes Jonah a false prophet.