[RPG] When attacking while invisible, when exactly does invisibility break

attackdnd-5einvisibilityspells

When using spells such as Invisibility and Mislead, and features or abilities such as the One with Shadows invocation and Misty Escape, you may become invisible and remain invisible until certain time limits or actions are taken, such as attacking or casting a spell.

Invisibility (Spell – PHB pg.254)

A creature you touch becomes invisible until the spell ends. Anything
the target is wearing or carrying is invisible as long as it is on the
target’s person. The spell ends for a target that attacks or casts a
spell.

Misty Escape (PHB pg. 109)

…you can vanish in a puff of mist in response to harm. When you take
damage, you can use your reaction to turn invisible and teleport up to
60 feet to an unoccupied space you can see. You remain invisible
until the start of your next turn or until you attack or cast a
spell.

I know some features allow you to remain invisible while attacking, like Greater Invisibility , but for those that do not, when exactly do you lose the invisibility trait? Is it different depending on whether or not you cast a spell, make a melee attack, or make a ranged weapon attack?

For instance, do you lose invisibility as soon as you nock an arrow, or when you let it fly, as simply placing it on your bow, or even drawing back the string is not attacking, per se.

Or perhaps you've cocked back a closed fist or heavy mace, do you lose your invisibility as soon as you begin to bring back the weapon, or when the steel connects with the target?

Also, if you were to cast Find Familiar, which has a casting time of 1 hour, are you invisible the entire time you are preparing the ritual up until the point the spell is finally cast, or are you immediately revealed as soon as you begin to prepare the ritual spell?

Best Answer

I can find no Sage Advice regarding the matter, but the rules about unseen attackers starts with this:

Combatants often try to escape their foes' notice by hiding, casting the invisibility spell ...(PHB 195)

This seems to suggest what I believe every table uses: If you are invisible, you attack someone who cannot see you with advantage, even if doing so breaks the invisibility.

Regarding nocking an arrow or swinging back for a punch: this would be a Ready action and not Attack or Cast a Spell, and thus would not end the spell invisibility.

If you cast a spell with a longer casting time

you must spend your action each turn casting the spell (PHB 202)

thus you reveal yourself on the first turn as you have taken a Cast a Spell action.