PHB, p. 195 says, under "Ranged Attacks in Close Combat":
Aiming a ranged attack is more difficult when a foe is next to you. When you make a ranged attack with a weapon, a spell, or some other means, you have disadvantage on the attack roll if you are within 5 feet of a hostile creature who can see you and who isn’t incapacitated.
Based on the rules cited above, consider the following situation.
- An invisible enemy is next to me.
- I'm unaware of it and it doesn't make any attempt to make itself known.
- I'm drawing my bow to attack a distant enemy.
In this situation, do I roll with disadvantage?
Best Answer
The hostile creature imposes disadvantage regardless
The "Ranged Attacks in Close Combat" rule does not let the hostile creature choose whether it wants to disrupt the ranged attacker. This rule assumes that the hostile creature always does its best to be hostile in combat, especially because this rule is risk-free. This is true even if the hostile creature wants to go unnoticed1.
Another way to look at it is that this rule defines a behavior common to all hostile creatures. If a DM wants a hostile creature to behave differently, they have two options: rule against RAW or rule that the creature is not hostile.
1. The "Ranged Attacks in Close Combat" and "Hiding" rules do not conflict.
The closest thing to "I'm unaware of it and it doesn't make any attempt to make itself known" is "It's hidden from me and wants to stay hidden".
Whether the hostile creature is unseen, unheard, or both is of no consequence for the the "Ranged Attacks in Close Combat" rule. Moreover, the hostile creature is unseen because it is invisible and does not need to make attacks of its own to disrupt the ranged attacker.
The only question is whether the hostile creature can disrupt the ranged attacker silently. At first glance this may seem farfetched, but it can still be narrated plausibly. Lets consider two examples of silent disruptions:
Is it difficult for the hostile creature to perform those disruptions silently? Does it require good timing and a distracted ranged attacker? Yes, yes, and yes! But our assumption is that the hostile creature is hidden from the ranged attacker, which means they already had a perception vs stealth contest that accounts for these interactions.