When will I get attacked in Clash of Clans
You can be attacked at any time where your shield is not active.
If you look at the top of the screen you will see an information label that says "Shield". At any time that this says "None" you can be attacked by other players (excluding times where you are actively playing - i.e. the game is open on your device).
When you first start the game you are given a free shield for several days to give you time to build your defences up. Your shield can later be reactivated:
- At any time for a set fee of gems (1 day, 2 day and 1 week options)
- If you are attacked by another player and lose 40% of buildings or town hall the shield is reactivated for 12 hours (war attacks do not count)
- If you are attacked by another player and lose 90% of buildings the shield is reactivated for 16 hours (war attacks do not count)
Attacking another player in multiplayer disables any shield you have.
You can also never be attacked whilst you have the app open.
You will get attacked no matter what in the game. The only time the goblins attack is in the tutorial. Other players will attack you after a while though, even if you don't attack since you need internet connection to play the game. You should worry about defences since they protect your village and more importantly your resources, since your buildings are not actually destroyed when someone attacks you.
With two separate accounts, I never used the attack function. Both of those accounts were raided two or three times until I won a defense (someone was dropping trophies). That one successful defense granted me 20 trophies, and I was never attacked again until reaching TH5 several months later.
As an experiment, I tried it again with a third account upgrading nothing but gold mines, elixir collectors, storage units, and town hall (zero defenses). Same as before, I won one defense, gained 20 trophies, and the attacks just stopped. Since I wasn't buying anything else, it took just over two weeks to get to TH5 with maxed out resource collectors, and then the attacks started coming. One guy attacked with three goblins, lost intentionally, my trophies jumped to 47, and the attacks became continual. I've tried dropping back to 20, but people simply revenge attack and lose intentionally. That said, I still don't lose many resources because most people with trophy counts this low have no intention of winning, just dropping trophies.
I'm convinced that you are safe until your trophy count rises above 20 (with the first 20 coming from a successful defense, NOT a successful raid) or you reach TH5.