Which of Mirror Image or Sanctuary trigger first when targeted, and are duplicates included

dnd-5espellstargeting

If both Mirror Image and Sanctuary are on the same creature, do I determine if a duplicates is hit before or after the effects of sanctuary happen?

Mirror Image says:

Each time a creature targets you with an attack during the spell's duration, roll a d20 to determine whether the attack instead targets one of your duplicates.

Whereas the relevant text from Sanctuary is:

Until the spell ends, any creature who targets the warded creature with an attack or a harmful spell must first make a Wisdom saving throw.

Which effect takes place first, if they are attacked? If sanctuary takes precedence (or the creature passes it's wisdom saving throw), and the attack goes through, does it need a second save to target the duplicate? If mirror image takes precedence, does sanctuary still try to prevent the attack?

Best Answer

In rare cases, effects can happen at the same time, especially at the start or end of a creature's turn. If two or more things happen at the same time on a character or monster's turn, the person at the game table - whether player or DM - who controls that creature decides the order in which those things happen.

Xanathar's Guide to Everything, page 77

So, if it's the NPC turn, your Dungeon Master decides what happens / triggers first. If it's your turn, you decide.

This is optional rule so if you are not using it at your table, then it's DM call. But I believe it to be a fair rule to follow, and using rules from the book can help to prevent disagreements.

Either way, both effects take place, if after the first one, the second one still makes sense:

So if sanctuary goes first and stops the attack, no roll for duplicate retargeting is needed. If mirror image goes first and the roll indicated the real character, then roll for the sanctuary takes place.

This is because if first effect prevented the attack, the second one does not do anything as it makes no narrative sense. The attacker is no longer being someone targeting the PC with an attack, and so is no longer a valid subject of the second effect.

If mirror image made someone target duplicate instead of protected character, then sanctuary has nothing to do as it only affects creatures targeting the warded person, per spell text. And attacker is no longer targeting warded person, he is targeting duplicate instead (again, per mirror image spell text).