What causes raids in Minecraft? Raids come when players enter the village with the Bad Omen effect. They are caused by someone unwittingly killing a pillager captain, then entering a village while they still have the Effect on them. This effect will happen if you, or your tamed wolf, kill a Raid captain/ When a player with Bad Omen effect enters a 3×3×3 subchunk region around a village center, the effect disappears and the raid starts.
The raid center is about because the average of the coordinates of all the claimed points-of-interest within the village within a spherical radius of 64 blocks of the player at the time the raid is triggered. The raid captain carry a banner that’s how you know them, because they carry this banner. Though Patrols can’t really be stopped unless you’re on Peaceful Mode, then they won’t spawn.
There really two ways to end the raid.
By winning. Kill all the raiders.
By losing. Let the raiders kill all the villagers or destroy all the beds.
You can take an opportunity from the raid, just run far enough away that the chunks unload. But the raid isn’t over, once you reload this area it’ll resume. This is still worth knowing, you’ll go fetch better weapons or armour, brew some potions, get more food etc.