If the attacking creature is an illegal target when the triggered ability tries to resolve, it won't resolve and none of its effects will happen. Vengeful Pharaoh will remain in your graveyard.
Vengeful Pharaoh
If Vengeful Pharaoh is no longer in your graveyard when the triggered ability would resolve, the triggered ability won't do anything.
If multiple creatures deal combat damage to you and to a planeswalker you control simultaneously, Vengeful Pharaoh will trigger twice. The first trigger will cause Vengeful Pharaoh to be put on top of your library. The second trigger will then do nothing, as Vengeful Pharaoh is no longer in your graveyard when it tries to resolve. Note that the second trigger will do nothing even if Vengeful Pharaoh is put back into your graveyard before it tries to resolve, as it's a different Vengeful Pharaoh than the one that was there before.
Magic: The Gathering · ™ & © Wizards of the Coast · Illus. Igor Kieryluk
Card data via Scryfall. Rarix is fan-made; not endorsed by the rights holders.
