This question already has an answer here:
I've always wondered this, but reaction attacks such as those given by certain feats and classes, i.e.:
These kinds of reaction attacks...
I don't think they're technically specified as the same as Opportunity Attacks, but I wanted to see what you guys thought. It matters specifically because in the feat Sentinel, it specifies that Opportunity Attacks turn the enemy's speed to 0 for the rest of the turn, but it also gives the ability to attack enemies that hurt your allies. I just wanted to know if these two abilities work collaboratively, or if they're kinda their own thing.
Note: I'm not going to tag this as Rules-as-Written because I want to see if anybody would argue that it should be a house rule that these should be allowed as Opportunity Attacks.
Opportunity Attacks are one specific type of "melee weapon attack as a reaction".
You can make an opportunity attack when a hostile creature that you can see moves out of your reach. To make the opportunity attack, you use your reaction to make one melee attack against the provoking creature. The attack occurs right before the creature leaves your reach.
Note that this specifies exactly when something is an Opportunity Attack.
Polearm master is an Opportunity Attack, though.
While you are wielding a glaive, halberd, pike, or quarterstaff, other creatures provoke an opportunity attack from you when they enter the reach you have with that weapon.
This is a case of Specific beats General - even though you will be making a melee attack when something is not "moving out of your reach", it is still an opportunity attack because the feat defines it as one.
When a creature within 5 feet of you makes an attack against a target other than you (and that target doesn’t have this feat), you can use your reaction to make a melee weapon attack against the attacking creature.
It does not specifically state that it is an opportunity attack. Since it is not done "when a hostile creature that you can see moves out of your reach", it is also not an Opportunity Attack by the general ruling. Thus, it is not an Opportunity Attack.
This is probably intended so it does not work together with the other effect from Sentinel
When you hit a creature with an opportunity attack, the creature’s speed becomes 0 for the rest of the turn.