PHB'14 p214, PHB'24 p242
8-level Enchantment
As you cast the spell, choose whether it creates antipathy or sympathy, and target one creature or object that is Huge or smaller or an area that is no larger than a 200-foot cube. Then specify a kind of creature, such as red dragons, goblins, or vampires. You invest the target with an aura that either attracts or repels the specified creatures for the duration. A creature of the chosen kind makes a Wisdom saving throw when it can see the target or comes within 60 feet of it. Your choice of antipathy or sympathy determines what happens to a creature when it fails that save:
Antipathy. The enchantment causes creatures of the kind you designated to feel an intense urge to leave the area and avoid the target. When failing the save the target gains the Frightened condition. The Frightened creature must use its movement on its turns to get as far away as possible from the target, moving by the safest route. The creature remains frightened while it can see the target or is within 60 feet of it. If the creature moves more than 60 feet from the target and can't see it, the creature is no longer frightened, but the creature becomes frightened again if it regains sight of the target or moves within 60 feet of it.
Sympathy. The enchantment causes the specified creatures to feel an intense urge to approach the target. When failing the save the creature has the Charmed condition. The Charmed creature must use its movement on its turns to get as close as possible to the target, moving by the safest route. If the creature is within 5 feet of the target, the creature can't willingly move away. If the target damages the Charmed creature, that creature can make a Wisdom saving throw to end the effect, as described below.
Ending the Effect. If the Frightened or Charmed creature ends its turn more than 60 feet from the target and can't see it, the creature makes a Wisdom saving throw. On a successful save, the creature is no longer affected by the target and recognizes the feeling of repugnance or attraction as magical. In addition, a creature affected by the spell is allowed another Wisdom saving throw every 24 hours while the spell persists.
A creature that successfully saves against this effect is immune to it for 1 minute, after which it can be affected again.