The brain rot of the LOTC community finds new ways to impress me every time. "YES!!! Let's find ways to make the server more boring so that I, the objectively main character of this pixel game, can romance rp with my 16-year-old elven waifu in peace!!!!!". Holy shit y'all are pathetic goddamn. If you really want warnings before a raid shows up, put actual players in watchtowers or outposts to act as scouts. Use actual players to patrol your lands and roads so that you have a better chance of spotting raids or bandit parties before they descend upon people. Ring your bells.
As kazoo said, THE ONLY people that want these kinds of systems are settlements and nations that are either too weak, have an ego bigger than Icarus, and cocky places that need ways to validate their "big and strong great power" rp while in reality, they aren't really a great power since they cant even deal with a bandit group of five people without a warning before hand LOL.
Then there's the fact that this warning will just kill conflict roleplay. People will log off after the notice has been given or close to when the raiders are allowed to roll up and raid. If not then it will just lead to banditry/raiding being a viable form of roleplay anymore since nations and settlements will make sure to rally before, maybe even bringing in other nations not related to the raid just so they can tip the scale of power and all get clicks.