Animals at nighttime

In Stardew Valley, you are supposed to pet your animals in the morning, make sure they have food (hay), and then open their door so they can go outside (in a fenced in area with grass).

I know you are supposed to close the door at night, but if you don't, they get unhappy or can die overnight. What time does it need to be closed before they start losing happiness? The wiki says 6 PM, but does that mean you have to be asleep or it will decline, or does the door just have to be closed?

On top of that, if it is 6 PM, does the chance for the animals to be eaten start then, or is that only overnight with the door open?


You don't need to close the barn doors at night. I have went in-game years without closing barn doors. Animals will go inside when they want with the doors open.

From the wiki, They will get unhappy if they are outside after 7PM

Animal outside past 7PM (-4 to -8 every 10 minutes does not stack with any other "every 10 minutes" effect)

But being inside has a similar effect

Player staying awake past 6PM, animal inside Barn or Coop (-4 to -8 every 10 minutes the Player stays awake, until a minimum of 150 is reached.)

You are misunderstanding how and when animals are attacked

From the wiki

If an animal has been trapped outside with the barn or coop doors closed, there is a chance they will be attacked by a wild animal during the night.

After the player goes to sleep, any events that will happen during the night (such as Bundle events) are calculated as normal. If no events are due to occur, there will be a 50% chance that the game will attempt to start a wild animal attack event. If this event proceeds, the game will go through all buildings to find a barn or coop that has their doors closed and has animals left outside.


Animals will not lose happiness until they are outside past 7PM, but they will start losing happiness if have already put them inside before then (starting at 6PM).

Thus, if you put your animals inside prior to 6PM, your animals will begin losing happiness then, because you are still awake.


Regarding the wild animal attacks, from the wiki section on this subject, it seems like the "wild animal attack" check is only performed overnight. It doesn't matter when the door is closed, so long as it is closed.

After the player goes to sleep, any events that will happen during the night (such as Bundle events) are calculated as normal. If no events are due to occur, there will be a 50% chance that the game will attempt to start a wild animal attack event. If this event proceeds, the game will go through all buildings to find a barn or coop that has their doors closed and has animals left outside.

However, from this, it sounds like this check is only done to see if any animals have been left outside and have their housing door closed behind them.

I've seen other threads that claim that leaving the doors open will not result in a wild animal attack, like this one:

I always leave the doors open. No reason not to really. If there's a downside to it, I've not noticed it. On the other hand, I hear you can potentially trap your animals outside leaving them vulnerable to wolves if you close them before they've gone in.

Another thread says something similar:

There is pretty much no downside. I leave it open all the time.

The only downside might be that goats supposedly don't like it, but mine are at 5 hearts for years now. It might take a bit longer to get them to 5 hearts though, but I didn't notice since I couldn't compare it


The door just has to be closed to prevent the decline in happiness, you don't have to be asleep. As long as you close the door every night before you go to sleep the happiness penalty is negligible.

The chance for animals to be eaten is only overnight. The chance gets rolled as soon as you go to sleep (as are other events). As far as I know animals only get eaten when you close the door and they're still outside, not when they're inside with the door open.