dnd 5e – Artificer Thunder gauntlets taunt effect

I’m currently DM-ing a campaign and one of my players is playing a Warforged Artificer Armorer. At lvl 3 he gains the Thunder gauntlets that as Tasha’s describes has a forced attack effect on the artificer.

“A creature hit by the gauntlet has disadvantage on attack rolls against targets other than you until the start of your next turn, as the armor magically emits a distracting pulse when the creature attacks someone else.”

the player of the class states that the creature first has to attack someone else before it finds out it gets disadvantage on attack rolls on other targets except him…

But what are the rules?

Does the creature that’s being hit know that if it attacks a different target that it has disadvantage?
Or does the creature really have to find out after first trying to target something else?

What is the range of the effect? Can a artificer/rogue do a hit and run tactic and impose disadvantage and/or trigger attacks of opportunity for their team members?

Please help me out.