Once you exit the game and your Village Guard expires, your village is open to attacks from other players. With a shield, you can protect your village and prevent other players from attacking you.
At the very start of the game, all players get a 3-day shield to prepare their village. After that, you can either buy shields for gems at the in-game shop, or make the most of the free shields activated after being badly damaged in an attack.
Depending on the extent of the damage, a shield will turn on, protecting your village for the next 12, 14 or 16 hours. However, an automatic shield appears only if the attacker deployed at least 1/3 of a full army (calculated according to your TH level).
Purchased shields last for 1, 3 or 7 days. Buying a shield is followed by a cooldown period, during which the same type of shield cannot be bought again. The cooldowns are 5, 10 and 35 days long respectively.
You can join the multiplayer game or visit another village using the 'Revenge' button as much as you want, even when your shield is active. Please note that if you start an attack by deploying a troop or spell, your remaining shield time will be reduced. The time-cost of attacking with a shield is 3h for the first attack, and rises with each attack from there on. With every new shield, the time-cost of attacking is reset.
You can participate in Clan Wars or play the single player campaign without fear of losing any shield.