Invasion

"Arise, arise, Riders of Théoden! Fell deeds awake: fire and slaughter! spear shall be shaken, shield be splintered, a sword-day, a red day, ere the sun rises! Ride now, ride now! Ride to Gondor!"

- Théoden in The Return of the King, The Ride of the Rohirrim

An Invasion is an in-game event that was added in the Beta 19 update on August 1st, 2014, along with Bandits. During these events, waves of foes will attack the player in a short amount of time.

Description
Unlike bandits, invasions don't come without warning; the first sign that you're going to be in for a fight is a low-pitched horn blow, and a message in the chat stating "The [Faction] have launched an Invasion!". These invasions can occur in almost any biome, from Rohan to Gondor to the Lone-Lands, but are most dangerous in "wilderness" biomes -- that is, Wilderland, Lone-Lands, and similar biomes. Some biomes can be invaded by more than one faction, and the chance for an invasion to happen varies depending on which biome is being invaded by which faction. It is possible for multiple factions to invade the same place at the same time.

When the invasion begins, a large weapon of the invading faction will appear floating over the ground, surrounded by flames that don't give off any light. When this happens, you have two options: run and hide, or kill all the enemy units. If you choose the latter, beware that a naturally-spawned invasion can result in 30 to 70 enemy units appearing within a very short period of time, but also note that slaying all the enemy units could result in you getting a lot of Alignment with the faction you're fighting with as well as loot. If you are in Creative mode, you can break the invasion spawner.

Mobs spawned in an invasion have a much longer sight range than normal mobs (40 blocks instead of 16) and mounted units have an even longer range of sight during an invasion; they can see enemies from up to 60 blocks away.

Every time the horn blows, between one and six enemy units will spawn, up to six blocks away from the invasion spawner.

The units spawned in an invasion can include any units the enemy has at its disposal. For example, a Rohirric invasion of the Uruk Highlands will contain mostly mounted Rohirrim and Rohirrim Archers, whereas an Angmar invasion of the Lone-Lands will contain all possible units allied with the Angmar faction.

The spawning of enemy units will end after several minutes and the sword will then explode (without damaging you) and disappear, thus ending the invasion.

Invasions can happen at any time of night or day, in most biomes (see the list below) although the chance of an invasion is greatly increased on nights when there is a lunar eclipse.

Beta 22
As of Beta 22, invasions now spawn with the sword of the appropriate faction (with the exception of Hobbits, Fangorn, Gundabad and some sub-factions because they do not have faction-specific weapons or armour.)

Also, a Horn of Conquest was introduced to give players the opportunity to summon invasions from allied factions.

Beta 24
Beta 24 saw many new sub-factions gain the capability to invade, including Dol Amroth, Nan Ungol, Hillmen, Rangers of Ithilien, and Black Uruks.

Beta 25
Beta 25 made it possible to spawn warg invasions for every evil faction that has wargs.

Tactics
There are several ways to cope with an invasion:

Run
The best thing to do when you hear the sound of the horn is just run the way you are facing. The invasion always takes place near the spot you are standing. As long as you stay near the floating sword, more waves of foes will show up. Fleeing is not cowardice, just pure survival instinct. After some moments running, you can turn around and cope with what is still following you. When you don't feel capable or equipped to deal with a large number of foes or when you would be fighting in difficult terrain just leave the place. Or is this just the challenge you're seeking?

Use the terrain
It's easier to attack downhill than uphill. Make sure that no trees, buildings or boulders obstruct your view. Think about holes in the ground or steep cliffs, where you could fall down when you've got to flee again. You can also hide behind some obstacles and wait for your foes to seek you out. Or fight with your back against a wall so there's no risk getting stabbed from behind but also no opportunity to flee. Perhaps circle around the floating sword in a distance to move yourself in a better position. Also, when you jump down while attacking a foe, you can deal more damage. Another good tactic is to make a pillar of blocks up and shoot at them.

Divide and Conquer
Or as the romans put it "divide et impera". Each time you go near the floating sword, the horn sounds and a new wave of foes will occur. So carefully reapproach the sword until the horn sounds and immediately back up a bit. Then deal with the wave that showed up until most of the foes are gone. Repeat this until the the sword disappears. You can either take out the foes from afar with a bow or crossbow, try to lure them away in small groups (remember that wargs have a longer tracking range) or wait until someone else takes care of them. Also remember, orcs sometimes take each other out in a skirmish.

This tactic should be used only if you have decent armour and weapons, or if a faction is invading land near your base (banners can help solve the latter problem). Despite the danger of death, the XP and alignment you'll get can make it worthwhile.

Take a break
When you are hurt, it's a good idea to leave the battle, take cover, eat something, perhaps drink a potion and wait until you recovered some of your health. Then reenter the fight. Your foes can wait that moment.

If you have magical drinks such as Athelas brew, Orc Draught, or Miruvor, now's the time to use them. The former brew will regenerate your health for a time, and all of the three drinks will boost your strength.

Avoid dangerous biomes
Make sure to travel the more peaceful regions of Middle Earth (see list below) if you've got the choice. For example, in Eriador and it's surroundings there are the Rangers of the North to back you up (if you are a good aligned player). When you are followed by some foes, it's a good idea to flee to a spot where some of your friends are waiting to take care of your pursuers.

Bring some friends
Hire some troops from a captain or travel with some players in a multiplayer world. That way you can help each other out, when someone is in trouble.

Collect the loot
When you hear an explosion sound, the sword disappears. You have to deal with the last wave of that invasion. After finishing off these last foes, you can peacefully walk the battlefield and collect all the experience orbs and the loot your foes have dropped. Don't do this during the fight, because gathering loot will probably distract you from the foe that deals you the deadly blow. In multiplayer don't start to quarrel about how to divide the loot!

Invasion List per Biome
This List shows which factions can invade which biome and what the chance is of it happening. Biomes not listed here cannot be invaded. The list of factions in this table is which factions can invade the biome.

Mechanics
As with the spawning of most NPC's and other mobs, the game code that runs invasions works the following way.

In-game "Tick"
About 20 times every second, the large program loop running Minecraft finishes running a full cycle. On each tick, various aspects of the game advance a little bit: moving objects change position, mobs check their surroundings and update their behavior, health and hunger are affected by the player's circumstances, and much more. One thing that does not happen as part of a tick is drawing graphics. Rendering happens after updating. This is why there can be a variance in fps (if vsync is not enabled) but the tps (ticks per second) will stay constant. This prevents video performance from affecting game mechanics, and vice-versa. An in-game day in vanilla Minecraft lasts exactly 24'000 ticks, while a day in Middle-Earth lasts 48'000 ticks.

Ticks and Invasions
On every in-game tick, there is a chance that an invasion spawner will appear. For example, assume that the chance of a Mordor invasion spawner spawning in Ithilien is 1/100'000, on any in-game tick. This means that there is about a 50% chance of a Mordor invasion occurring on any given day!

Spawner Spawning
When the game decides to spawn an invasion spawner, it picks a random location within 16 blocks of the player and a random number between 30 and 70 (inclusive), which is the number of mobs that spawner will spawn. Then, every 10 to 15 seconds, between one and six mobs will spawn. This will continue until the MobsRemaining value (see below) of that spawner reaches zero.

An invasion spawner will only work when the player is within 32 blocks of the spawner; if you're too far away, then the spawner will simply stop spawning for a while, but it won't despawn until it's finished spawning all the mobs it can, even if the chunk is unloaded.

Summoning Invasions
Invasions of any faction can be summoned anywhere at varying sizes using the following command: /summon lotr.InvasionSpawner ~ ~ ~ {Faction:FACTION,MobsRemaining:X} The FACTION is replaced with the faction name, and units of that group will be summoned. The X is replaced with the total number of mobs to be spawned before the invasion is over.

As of Beta 22, you can also use the Horn of Conquest to summon an invasion, however these cost two thousand coins and you must have one thousand five hundred alignment with the faction to use.

Trivia

 * It is possible to summon an Utumno invasion spawner, but it will despawn a tick later, and no NPC's will spawn. The same happens when you attempt to spawn a Dark Huron invasion spawner.
 * Although Fangorn has neither a legitimate way to obtain a Horn of Conquest nor a chance to invade lands, a summoned invasion spawner will still spawn Ents and Huorns. The invasion symbol of Fangorn is a wooden stick.