[RPG] Can you benefit from Horde Breaker if you attack as part of Booming Blade or Green Flame Blade

dnd-5erangerspells

The booming blade and green-flame blade cantrips from the Sword Coast Adventurer's Guide both have the particularity of including a single melee weapon attack as part of their casting.

Several martial abilities, like Extra Attack or the Martial Arts’s bonus attack, do not work with these cantrips because they require the Attack action to be used.

However, the Hunter Ranger's Horde Breaker ability (which lets you do an additional attack on another target with the same weapon once per turn) only requires an attack with a weapon, not necessarily the Attack action. Therefore, I’m wondering if a Hunter Ranger with Horde Breaker could get that additional-attack-on-different-target-with-same-weapon when using booming blade or green-flame blade.

Best Answer

Yes

Horde Breaker states (PHB, p. 93, bold added):

Once on each of your turns when you make a weapon attack, you can make another attack with the same weapon against a different creature that is within 5 feet of the original target and within range of your weapon.

For both Green Flame Blade and Booming Blade, you do make a weapon attack:

You brandish the weapon used in the spell’s casting and make a melee attack with it

Note that you won't get any of the benefits of either spell a second time for the second attack, as explained in V2Blast's answer to this Q&A: Can Green-Flame Blade be cast twice with the Hunter ranger's Horde Breaker ability?