"Perhaps they will listen and everyone will turn from his evil way, that I may repent of the calamity which I am planning to do to them because of the evil of their deeds," (Jer. 26:3).
The Lord often speaks to us in our time reference so that what He wants to accomplish gets done. It is important to understand that God brings about certain changes in people by telling them that they will be punished if they continue in sin. They hear God's pronouncement, change their ways, and repent. God then "changes" from punishing them to blessing them. This does not mean that God did not know from all eternity that they would change their ways. It means that from all eternity God ordained the means by which they would change, namely, His pronouncement of judgment which would motivate them to change. It is this working in our time frame that is necessary for us, not God. The means God uses to bring change is often the appearance of options He gives us. As free creatures, He gives us the choice to change--knowing ahead of time what our choices will be should He warn us, thereby bringing about change through His interaction with us. This is a better explanation than assuming that God is ignorant, can make mistakes, and takes chances.
In Jer. 26:3, God is giving the cities of Judah a warning urging them to change. From the human perspective, perhaps they will change. Perhaps they will not. We don't know, but God knows.