Raid

A raid is an in-game event in which waves of various mobs, mainly illagers, spawn and attack a village. It is triggered when a player with the Bad Omen status effect enters a village.

Spawning
A player with the Bad Omen status effect triggers a raid upon entering a chunk with at least one villager and a claimed bed, or one of the 8 chunks surrounding it in a square. $$, a villager with a claimed bell or job site block can also trigger a raid, even if no claimed beds are present.

Bad Omen is obtained when a player kills an illager captain, which can be found at pillager outposts, woodland mansions or in patrols. If a player kills multiple captains $$, the Bad Omen accumulates up to Bad Omen VI, causing members of the raiding party to have an increased chance of having enchanted weapons. Killing a patrol captain gives 1–6 Bad Omen levels, while killing an outpost captain always gives 1 level. $$, the Bad Omen effect does not stack by killing multiple captains.

Starting
When a player with Bad Omen effect enters a 3x3x3 subchunk region around a village center, the effect disappears and the raid starts. The raid center is set as the average of the coordinates of all the claimed points-of-interest in the village within 64 radius (spherical) of the player at the time the raid is triggered. A bossbar labeled "Raid" appears and begins charging. The bossbar is visible to players up to 96 blocks away (spherical) from raid center. $$, the bar is red and represents the total remaining health of the raid mobs, while $$, the bar is purple, and represents the number of remaining mobs. The number of mobs still alive display when there are fewer than three remaining. A horn sounds at the start of each wave (and $$, during the wave), from the direction of the wave spawn and 13 blocks away from the player, and the village bell rings while the bossbar charges ($$, villagers ring the bell, while $$ it rings by itself). Each subsequent wave is larger, with more mobs, including pillagers, witches, evokers, ravagers, and vindicators.

Joining
$$, illagers, and witches not spawned as part of the raid (e.g. from a patrol) may join the raid and be counted by the bossbar. Illusioners can also join the raid. Raid captains may also join but do not trigger a new raid when killed.

$$, illagers cannot join raids. If a new raid is triggered after all beds are destroyed and then replaced, previously remaining illagers are not counted in the new raid bossbar.

Raid captains are currently unused $$.

Captains
When a wave captain is killed $$, other illagers in the raid try to pick up the banner dropped by the previous leader; the illager that retrieves the banner becomes the new wave captain.

A player does not receive the Bad Omen effect when killing the patrol captain within a village. The captain is always a vindicator upon spawning, if possible.

Raid wave spawning
The raid spawns several waves of raider mobs. To find a valid spawn target location at the beginning of each raid wave, there are 3 spawn attempt phases with 20 attempts per phase. For each attempt, a random location is chosen a certain radius away from the raid center (64 block radius in 1st phase, 32 in 2nd, and 0 in 3rd) at a random horizontal angle, with fractional results rounded down. Additionally, a random 0-4 is added to x and z coordinates. In effect the three spawn attempt areas are two rings and a 5x5 square. The target height is always on top of the topmost non-air block. For spawn location to be valid, the block underneath must have a solid opaque top face or be snow. Valid blocks include full blocks, upside down slabs/stairs, soulsand, and packed/blue ice, but not glass, leaves, light-emitting blocks, trapdoors, regular ice, or carpet. ($$ the raid can spawn on any block except leaves and scaffolding). Any light level is fine and player proximity doesn't matter. The location must not be within a village boundary (except for phase 3) and must be in an entity-ticking chunk. If no valid location is found in one phase, the next phase is tried. If all three phases fail, the raid ends. Once a valid location is found, the horn sounds and all raider mobs for that wave spawn there at once. They then spread out by entity cramming and start moving towards the village. Once all raiders are killed, there is a 15 second cooldown before next wave. However, if the last raider happens to move outside 112 radius (spherical) from raid center, or the entire wave spawns outside that radius (which can happen with large differences in y), then the next wave spawns immediately. Raiders that are part of a raid do not despawn naturally and do not contribute to the mob cap, but will resume despawning once the raid is over or they leave it.

Java Edition
The number of waves depends on difficulty: There are 3 waves in Easy difficulty, 5 in Normal, and 7 in Hard. In Hard, there is a chance of 1 additional pillager and/or vindicator spawning.

When triggered with Bad Omen I, illager weapons are unenchanted. Bad Omen II-VI each increases the possibility of low-level enchantments.
 * Easy and normal difficulties

With Bad Omen I, illager weapons have a 10% chance to hold mid-level enchantments. With Bad Omen VI, there is a 70% chance of this.
 * Hard difficulty

Bedrock Edition
$$, the number of waves depends on difficulty, regardless of Bad Omen level without any additional waves. There are 3 waves in Easy difficulty, 5 in normal, and 7 in hard difficulty. They spawn with enchanted weapons at level 5 on easy and at levels 5-19 in other difficulties.

Loot
Every mob in a raid drops their own items.

The raid captain drops
 * Special Drops
 * 1 Ominous Banner

$$
Pillagers, vindicators, and evokers drop their regular loot.

$$
In addition to regular loot, pillagers and vindicators can drop: Additionally, depending on difficulty, they have a 65% chance of dropping on easy and normal, while 80% chance of dropping on hard: Note:
 * 0-1
 * 0-1 ($10/39$ chance)
 * 2-3 ($20/78$ chance)
 * 4-5 ($5/39$ chance)
 * 1 ($10/78$ chance)
 * 1 ($2/39$ chance)
 * 1 ($4/78$ chance)
 * 1 ($2/39$ chance)
 * 1 ($4/78$ chance)
 * 1 ($5/78$ chance)
 * 1 ($5/78$ chance)
 * 1 ($5/78$ chance)
 * Iron equipment from raider drops has 50% chance of being enchanted with random enchantment(s) at a low-to-medium level.
 * Iron equipment from raider drops is always damaged.
 * Emerald is both a regular raid drop and an additional drop.
 * Only emerald drops are affected by looting enchantment, increased by 1% per looting level.

Bad Omen
$5/78$, besides triggering a raid, the Bad Omen status effect's level of the triggering player also affects the raid mechanism. When the Bad Omen level is higher than one, an additional wave spawns with the same strength as the final wave. With a higher level of Bad Omen to a raid, the illagers in the raid have a higher chance of being equipped with enchanted weapons or armor. When the raid ends in a victory, the players receive Hero of the Village effect at the same level as the Bad Omen level of the raid.

Ending
If the attacked village no longer registers as a village (i.e. all villagers were killed or all claimed beds were destroyed), the raid ends, the Raid bar displays "Raid - Defeat", and all of the illagers celebrate: the evokers, pillagers and vindicators raise their hands, the pillagers jump up and downor raise their hands, and all of them emit "celebration sounds".

$5/78$, if the last villager is not killed but turned into a witch (by a lightning strike), it would not be considered defeated. The job-site block is here recognized as the village. That means if the surrounding chunks of the job-site block are entered by a player with the Bad Omen effect, it triggers a Raid. (Villagerless Village)

If all illagers are killed in the final wave, any player who has killed an illager in the raid receives the Hero of the Village effect, the villagers shoot off fireworks, and the Raid bar displays "Raid - Victory".

$5/78$ if the village being attacked by a raid no longer registers as a village (i.e. all villagers were killed or all claimed beds were destroyed), the raid ends, the Raid bar instantly disappears, and all of the illagers celebrate: the evokers, vindicators, and pillager raise their hands, and all of them (including witch and ravager) emit "celebration sounds".

Raids cannot end naturally if at least one baby villager remains, due to illagers being unable to attack baby villagers and destroy beds.

Villagers
$5/78$ during a raid, villagers emit "sweat particles". At least one villager rushes to the village meeting point and rings the bell to alert other villagers to get inside their houses during the warmup of an upcoming raid wave.

After successfully defending a village from a raid, the villagers emerge from their houses and celebrate, by setting off firework rockets and cheering.

Witches
$5/78$, witches participating in a raid often help other illagers by splashing a regeneration potion or healing. Witches do not attack villagers and do not throw harmful potions at them.

$$, witches participating in a raid do not heal other illagers, but still attack the player and also iron golems.

Mobs not counted
Vexes summoned by evokers do not count as part of the raid. Killing them has no effect on the raiding bar, and the raid ends in victory even if there are vexes remaining.

Expiring
If a raid goes on for too long (roughly an hour) the raiding bar disappears, and a message appears saying "raid expired".

Trivia

 * If the player leaves a village during a raid, obtains another level of Bad Omen, and returns to the village, then the effect is nullified and has no effect on the progressing raid.
 * The horn sound that blares at the start of each wave is created by a corkscrew didgeridoo.