The magic mouth spell plays a message that is uttered when a trigger condition is met, and states:
The triggering circumstance can be as general or as detailed as you like, though it must be based on visual or audible conditions that occur within 30 feet of the object.
In previous editions, it specified that line of sight was required to activate, but in 5e it doesn't. Does this mean that a magic mouth can activate based on things that are not invisible, but without direct line of sight to the object, such as a goblin behind a wall?