Essentials and VanishNoPacket do this. They block the sending of certain packages of a "vanished" player to other players/entities, as far as I know. So the player will not be recognized at all by other clients or mobs. But I can't provide example code for it. If no one will explain it in detail you can have a look at the Essentials code or the VanishNoPacket code on GitHub for example. (see their BukkitDEV pages for links to the source code)