In 3 John 10, we read the following:
Wherefore, if I come, I will remember [Diotrephes'] deeds which he doeth, prating against us with malicious words: and not content with, neither doth he himself receive the brethren, and forbiddeth them that would, and casteth them out of the Church.
"If I come" is a proper translation of the Greek ἐὰν ἔλθω, being composed of (1) ἐὰν, a marker of condition and (2) ἔλθω, the first person subjunctive active of ερχομαι. With respect to εαν being coupled with a verb in the subjunctive, one leading grammarian wrote:
This is the use of the subjunctive in the protasis of conditional sentences. The conditional element is made explicit by the particle ἐάν. Both the particle (a combination of εἰ and the contingent particle ἄν) and the subjunctive give the condition a sense of contingency. This is a relatively common usage of the subjunctive, occurring nearly 300 times in the NT. (Daniel Wallace, Greek Grammar Beyond the Basics, pp. 469-70)
In essence, John, while inspired by the Holy Spirit and writing God-breathed (θεοπνευστος) revelation (cf. 2 Tim 3:16) did not have exhaustive but contingent foreknowledge about his then-future actions.