Invasion

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 their associated 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 sword 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.

Mobs spawned in an invasion have a much longer sight range than normal mobs -- 40 blocks instead of 16. 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 and Gundabad, because they do not have faction-specific weapons or armour.)

This was suggested by Commandogregor1234. Also a Horn of Conquest was introduced to summon the invasion.

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 directly near the spot you are standing. As long as you stay near the floating sword, more waves of foes will show up. Fleeing is no 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 surround yourself with sugarcane. Mobs cannot see you through sugarcane, but you can see and even 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! which is rather rotten luck.

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.

Since Beta 22, you can also use the Horn of Conquest to summon an invasion.