Clash of Clans It is based on general lines in a game of surprise confrontations in its Multiplayer mode that is the means to obtain resources par excellence, and if you wonder if it is possible to be attacked while you are online or active, whatever you want to call it, then you have reached the correct place…
Clash of Clans It will allow you to attack random villages through a mechanism called matchmaking that works by displaying a series of villages at your level from which you can obtain resources.
But you will also receive a lot of attacks, with the caveat that these will only happen when you are offline. You will never be attacked while you are online or active because that is the moment in which you restore your village from the attacks received and prepare for revenge or search for new enemies.
In this way the game is balanced otherwise you could never gather resources since you will always be being robbed.
You won't be able to attack the same village twice in a row either, since after a lethal attack the villages enter a shield protection that will last until they attack again.