Matthieu, how would I do that in my ordinary single-player non-realm world?
Same problem: I have played in my single-player world (windows 10) for around a year and always had thunderstorms. Started collecting skulls recently using my channeling trident, and suddenly noticed that I wasn't getting thunderstorms anymore, not one in 20+ hours of gameplay, with plenty of rain events. During a recent rain event, I noticed a zombie walking around during the day without burning, so I presume I got a "thunderstorm" but no lightening whatsoever?
It is quite peculiar that during all these hours of gameplay without lightening, I was also not visited by the wandering trader anymore, which can't be a coincidence. He occurred very commonly at my base before.
I GOT THUNDERSTORMS AGAIN!! Hurrah, my world is saved. I am not sure what "saved" it, it might have been something in the 1.13 update (although I had around 4 or 5 rain events since the update without lightening). However, what I think fixed it was a "peaceful cycle", just quickly changing from "normal" to "peaceful" and back. I always suspected that my collecting surface mobs in a blast chamber for skull collection caused the "crash" (I had collected around 30 in one chunk). Possibly there is some - indirect - connection between mob cap and thunderstorms as they also allow hostile mobs to spawn by day. However, just killing off the mobs didn't help, so if it was the peaceful cycle, it must have been something more basic. Whatever... If you also encounter that problem, for which it seems there are several sources, just try a "peaceful cycle". Good luck. Now, back to skull collecting and skeleton horses. Yayyy...