Skip to content

Feat/disable phantom spawning in vanish - #6646

Open
MochaMilkie wants to merge 4 commits into
EssentialsX:2.xfrom
MochaMilkie:feat/disable-phantom-spawning-in-vanish
Open

MochaMilkie wants to merge 4 commits into
EssentialsX:2.xfrom
MochaMilkie:feat/disable-phantom-spawning-in-vanish

Conversation

@MochaMilkie

@MochaMilkie MochaMilkie commented Nov 6, 2026 •

Copy link
Copy Markdown

Information

This PR closes #6645.

Details

Proposed feature:

When a player is vanished, the insomnia/phantom timer should be paused, so phantoms can't spawn for vanished players, regardless of gamemode

This was solved by adding an event listener that cancels any attempt to spawn a phantom that is targeting a vanished player. Then a listener watches for vanish status change and when vanish is enabled the "TIME_SINCE_LAST_REST" is stored in the User object and recalled and applied to .setStatistic() using the value stored when vanish was entered.

Environments tested:

OS: Ubuntu 26.04

Java version: 27

  • Most recent Paper version (26.1.2, git-Paper-74)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Demonstration:

Tests provided to demonstrate persistent data for the time since the player last slept before and after vanishing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent phantom spawning in vanish

1 participant