Armor of Agathys
A protective magical force surrounds you, manifesting as a spectral frost that covers you and your gear. You gain 5 temporary hit points for the duration. If a creature hits you with a melee attack while you have these hit points, the creature takes 5 cold damage.
Protective bond
Beginning at 6th level, the bond you forge between people helps them protect each other. When a creature affected by your Emboldening Bond feature is about to take damage, a second bonded creature within 30 feet of the first can use its reaction to teleport to an unoccupied space within 5 feet of the first creature. The second creature then takes all the damage instead.
If a peace domain cleric is about to take bludgeoning, piercing or slashing damage from a melee attack and a warlock, who has armor of agathys, uses their reaction to teleport in due to protective bond, does armour of agathys activate and damage the attacker?
the second creature takes all the damage instead
in what way does the second creature take that damage?
Is the damage being redirected from the attacker to the second creature (so armor of agathys would activate)? or is protective bond absorbing the damage and outputting it as magical bludgeoning, piercing or slashing spell?