Vanish
Vanish state is a simple in-memory Map<UUID, String> on VanishServiceImpl (playerId → name), but it drives three independent layers of hiding: Bukkit's built-in show/hide-player API, a packet filter, and a large block of cancelled gameplay events. All three read the same isVanished(UUID) check.
Visibility
hidePlayer(Player) calls Player#hidePlayer(plugin, target) for every online player except those with staff.vanish.see and the vanished player themself. showPlayer(Player) reverses this. Both also toggle Player#setSleepingIgnored so a vanished player doesn't block/unblock everyone else's sleep, and hidePlayer clears the vanished player as a target from every nearby Creature so mobs already chasing them immediately give up.
On join (VanishListener#onJoin, LOWEST priority):
If the joining player has
staff.vanish(i.e. is staff), they are preemptively hidden and their join message is suppressed — this covers the window before AstralSync'sapply()callback (which restores the correct persisted vanish state) has run.If the joining player lacks
staff.vanish.see, every currently-vanished player is hidden from them individually (player.hidePlayer(...)), since the vanished players' ownhidePlayercall happened before this player existed to be hidden from.
On quit (VanishListener#onQuit, LOWEST priority): a vanished player's quit message is suppressed and their entry is removed from the in-memory vanished map (invalidate).
Packet filtering
VanishPacketListener (a PacketEvents SimplePacketListenerAbstract) strips vanished players out of two outbound packet types for any viewer lacking staff.vanish.see:
Packet | Effect |
|---|---|
| Removes any command-match suggestion whose text is a vanished player's name (e.g. |
| Removes vanished players' entries from the player-info packet (tab list). If every entry in the packet was a vanished player, the packet is cancelled outright rather than sent empty. |
Both cases mark the packet for re-encoding after mutation so the trimmed version is actually sent.
Blocked gameplay events
While a player isVanished, VanishListener cancels the following. The container/block/pressure-plate/ damage/target/pickup/entity-interact/mount/bucket handlers run at HIGH priority; the rest run at the default (NORMAL) priority:
Event | Behavior |
|---|---|
| Container interaction is cancelled and denied; for |
| Cancelled. |
| Cancelled. |
| Cancelled and denied. |
| Cancelled if the damager is the vanished player, directly or via a projectile they shot. |
| Cancelled if the vanished player is the one taking damage. |
| Cancelled if a mob targets the vanished player. |
| Cancelled (item-swap pick, not physical item pickup). |
| Cancelled — no crop trampling. |
| Cancelled — no leaf tilt. |
| Cancelled if every eligible human present is vanished (a mixed group of vanished + visible players still triggers it for the visible ones). |
| Cancelled if the triggering player is vanished. |
| Cancelled if every player within 16 blocks (256 squared) of the spawner is vanished. |
| Cancelled if the triggering player is vanished. |
| Cancelled if the triggering entity is a vanished player. |
| Cancelled. |
| Cancelled — no egg-crush chance. |
| Cancelled if it would lower a vanished player's food level (hunger loss only — food gain from eating is unaffected). |
| Cancelled — vanished players can't right-click-interact with entities. |
| Cancelled if the mounting entity is the vanished player. |
| Cancelled. |
| Cancelled. |
None of these are documented as reversible per-event toggles — they are unconditional while vanished. There is no configuration for this list; changing it requires editing VanishListener in source.
See also
Overview → Vanish — the service, cross-server sync, and how other plugins can query vanish state.