How does Ancestral Protectors' resistance work against multiple damage types?

While raging, an Ancestral Guardian barbarian (Xanathar's Guide to Everything, p. 9-10) can activate Ancestral Protectors on a creature he/she has just attacked. The ability states that:

Until the start of your next turn, that target has disadvantage on any attack roll that isn’t against you, and when the target hits a creature other than you with an attack, that creature has resistance to the damage dealt by the attack.

If said creature deals multiple types of damage in one attack - if a creature is resistant to all of those forms of damage, this answer states that each damage type is halved before damage is totaled. However, Ancestral Protectors does not give resistance to each type of damage dealt by the attack - it gives resistance to the attack itself. When calculating the damage dealt, would you still calculate it per the linked answer, or would you add it all, and then apply resistance?

To use the example from the Uncanny Dodge question: If the attack dealt 5 bludgeoning damage and 3 piercing damage, would Ancestral Protectors reduce it to (5+3)/2 = 4 damage, or would it reduce each packet individually for 3 damage total?

In short: Does gaining resistance to the damage of an attack mean gaining resistance to all types of damage contained in that attack, or does it mean halving the total damage of that attack?

You halve each damage type separately

As shown by your linked questions, you need to halve each damage type separately as the math is different depending on whether or not those damage types have odd or even values.

While the functional difference may be small in the end, it is different and could be enough to knock a creature unconscious in the correct circumstance.

Damage Dealt

The key line here is

damage dealt by the attack

You do not have Resistance to the attack (there is no such thing), you have resistance to damage dealt by the attack. Once we start looking at damage, then we look at it the same way in terms of each type.

• Thank you. I edited a bit to try and clarify - I'm wondering if this is different because you aren't gaining resistance to damage types, but to the attack as a whole? – Reibello Aug 23 '18 at 17:45
• If you're differentiating between "damage dealt by the attack" and "the attack", why wouldn't you also differentiate between "damage dealt by the attack" and "damage type of the attack"? – Isaac Reefman Aug 24 '18 at 5:48
• I had another thought about this answer - how do you break down the damage types to halve, seeing as they often overlap? Supposing a single attack does non-magical piercing, bludgeoning and fire damage, plus say hex for some magical necrotic damage, do we treat it as 4 types, 2 types (split by whether it's magical/elemental or not) 3 types (physical, elemental, magical)... How would we decide? – Isaac Reefman May 29 at 22:50

You have resistance to damage, not damage type

While NautArch's answer correctly identifies that this small potential difference can have meaningful consequences, I disagree with his interpretation of the text: It appears to me that there are at least 4 important terms here:

Resistance - A trait that halves damage taken. Defined in PHB 197 this only deals with resistance to damage types, which is the source of confusion for this question.

Attack - The entire event defined in the rules by the Attack Action. As NautArch identifies, it doesn't make sense to have resistance to an Attack.

Damage - the result of a damage roll, which (PHB 196) includes the damage die or dice and any modifiers. This question is heavily affected by whether Resistance can be applied to damage in general.

Damage Type - There are many different damage types, such as bludgeoning, fire and poison. Some damage types overlap, and not all damage types are always explicitly stated..

Multiple instances of resistance or vulnerability that affect the same damage type count as only one instance, For example, if a creature has resistance to fire damage as well as resistance to all nonmagical damage, the damage of a nonmagical fire is reduced by half against the creature, not reduced by three-quarters. - (PHB 197)

The upshot of this is that if we rule that you can't have resistance to damage, only to damage types, we have a choice someone needs to make: