No, detect magic doesn't automatically detect spellcasters as magical
The Sage Advice Compendium addresses a related question:
Is the breath weapon of a dragon magical?
If you cast antimagic field, don armor of invulnerability, or use another feature of the game that protects against magical or non-magical effects, you might ask yourself, “Will this protect me against a dragon’s breath?” The breath weapon of a typical dragon isn’t considered magical, so antimagic field won’t help you but armor of invulnerability will.
You might be thinking, “Dragons seem pretty magical to me.” And yes, they are extraordinary! Their description even says they’re magical. But our game makes a distinction between two types of magic:
- the background magic that is part of the D&D multiverse’s physics and
the physiology of many D&D creatures
- the concentrated magical energy that is contained in a magic item or
channeled to create a spell or other focused magical effect
In D&D, the first type of magic is part of nature. It is no more dispellable than the wind. A monster like a dragon exists because of that magic-enhanced nature. The second type of magic is what the rules are concerned about. When a rule refers to something being magical, it’s referring to that second type. Determining whether a game feature is magical is straightforward. Ask yourself these questions about the feature:
- Is it a magic item?
- Is it a spell? Or does it let you create the effects of a spell that’s
mentioned in its description?
- Is it a spell attack?
- Is it fueled by the use of spell slots?
- Does its description say it’s magical?
If your answer to any of those questions is yes, the feature is magical.
Let’s look at a white dragon’s Cold Breath and ask ourselves those questions. First, Cold Breath isn’t a magic item. Second, its description mentions no spell. Third, it’s not a spell attack. Fourth, the word “magical” appears nowhere in its description. Our conclusion: Cold Breath is not considered a magical game effect, even though we know that dragons are amazing, supernatural beings.
Detect magic, like other game mechanics, operates by this same logic with regard to what is considered magical. The spellcasting abilities of creatures (innate or otherwise) are considered "the background magic that is part of [...] the physiology of many D&D creatures". Detect magic is designed to detect magical effects, not the background magic that suffuses creatures or the universe.
Chris Perkins confirms this sort of interpretation here:
Can detect magic detect magic potential of spellcasters even if they're not actively casting a spell?
It's not a wizard detector, if that's what you mean.
Given that the question he's responding to asks about spellcasters in general, it seems clear that his response is not specific to wizards - he's suggesting that the spell doesn't automatically detect spellcasters simply due to their magical abilities.
Eldritch Sight (PHB 110) allows you
cast detect magic without expending a spell slot
An illusion is magic, so they will detect its presence automatically within 30', and will also be able to use an action to see the aura around the specific source and determine the school of magic, per the Detect Magic spell. Note, the illusion itself won't show an aura, but the trap trigger should, if the warlock is within range of it when it is triggered.
According to Jeremy Crawford (lead rules developer on 5e), when he was asked on Twitter
Would Detect Magic show an aura around an illusion?
His response was
Detect Magic lets you see an aura only around a visible creature or
object, not around an illusion. But you can sense the magic.
So the warlock would be able to sense the presence of the magical trigger or illusion source and could detect that it has an illusion school aura if he can spend an action. If the trap is already triggered (assuming the illusions are cast by a trap) then the illusion itself will set off the magic "spidey sense" but wouldn't have an aura. The warlock would have to be within 30' of the trigger/source.
There are a few ways to confound a player using Detect Magic, though you really ought to accept this PCs capability and use it for good story moments, rather than trying to shut it down, which will only frustrate the player.
There are so many things radiating with magic that the PC can't distinguish between illusions and just ordinary things that have some residual magic aura without spending a lot of time (actions). Presumably whoever created this haunted house knew of Warlocks and this ability, so they planned accordingly. So give the PC lots of things to investigate, eventually they will get bored and walk into a trap. It is also possible that the use of Nystul's Magic Aura could mask the magical aura of the trigger/source as another school of magic. I would postulate that a warlock who uses Detect Magic frequently would habituate to the magic used by the party (the fighter's magic sword, the thief's magic ring, etc) and could detect a new magic source, lest Detect Magic become fairly useless unless the warlock is alone and divests himself of all his other magic items.
Using this magical ability attracts negative attention. Maybe the house responds aggressively to use of magic, the walls close in, things fly at the magic user, etc. This will force the PC to limit use of the ability.
Accept it and let the PC detect all the illusions and their source if he is close enough. But remember that things can block Detect Magic, like 1 foot of stone, 1 inch of metal, etc. So chests and such could be behind secret, non-magical doors.
The range is also only 30', so things farther than that won't show an aura. An illusion on a high ceiling, or at the end of a long room will require the PC to get close to even tell there is magic involved. Use that to your advantage to lure them into non-magical traps. After a few, they will learn to stay back :)
This is also eating up their concentration slot, as the invocation lets them cast the spell without using a slot but doesn't relive them of the need for concentration. So they can't have another concentration spell active. And if something happens that requires them to make a concentration roll and they fail, there could be a brief period of time where an illusion could pop up and the warlock won't be able to sense magic, or determine that it is just an illusion. So you could have a mundane threat that injures the warlock, breaks their concentration, then you trigger an illusion that they do react to. Your warlock may forget to recast the Detect Magic spell or prioritize other actions instead.
Mundane creatures with magic items will also trigger the magic sense, but the warlock will have to burn an action to see the source. Have a series of skeletons come at them, the first two just illusions, by the third the warlock may make an assumption that it too is just an illusion and then someone gets hit with the magic sword a real skeleton is carrying! Or vice versa, so the party wastes resources attempting to attack the third illusionary skeleton after fighting the first 2 real ones.
But again, you should embrace this ability, as it is the PCs area to shine and something they obviously care about, since they took that invocation over other ones. Be careful trying to negate it completely. Instead use it to make the character take risks.
Best Answer
Detect magic has a passive mode and an active mode.
Passive mode: Yes/no there is magic within 30 feet
Once you cast the spell (and keep concentrating on it) you passively become a magic detector. While in passive mode if there is magic within 30 feet of you (not blocked by 1 foot of stone, yada yada) then you begin to beep and so know it is. Note that since it lasts awhile you don't have to ask every round, "Do I sense magic?", instead the DM should just tell you you're beeping.
Active mode: You know which object/creature has magic, and you know the school the magic is from
Once you know some magic is nearby you may use you action in a given round to gain short-range magic finding vision. In exchange for spending an action you'll be able to see magic on any visible creature or object in 30 feet and even see what school the magic is from.
Limitations ##
Passive mode can be pretty hard to use if you personally have magic items (like healing potions) or commonly have spells cast on you (like mage armor) you will constantly be beeping, "Magic, Magic, Magic". Also remember that your allies may have magic which will also set off the magic detector. Your wizard is a very sensitive instrument and for best results you should thoroughly clean them of excess magic and remove any interfering signals from the area before use.