Problem Description
I’m trying to make a plugin so that when a player goes to sleep:
What Actually Happens
Server & Development Environment
What I’ve Tried So Far
Expected vs. Actual Behavior
Thank you for taking the time to read and help!
I’m trying to make a plugin so that when a player goes to sleep:
- They get the usual horizontal pose and fade‐to‐black animation
- Do not skip the night
- While the screen is black, the player is teleported “behind the scenes” (as if they entered a dream)
- The screen then fades back in—all without the player noticing the teleport itself
What Actually Happens
- I can detect the PlayerBedEnterEvent and force the sleep pose
- I cannot find any Paper API or NMS method/packet that triggers the client fade‐to‐black or fade‐back
Server & Development Environment
- Minecraft: 1.21.4
- Server software: Paper 1.21.4
- Java: 17
What I’ve Tried So Far
- Inspecting Paper’s API for any “fade” or “screen effect” methods (no matches)
- Reviewing EntityPlayer and PlayerConnection NMS methods for hidden screen controls
Expected vs. Actual Behavior
- Expected:
- Client fades to black
- Plugin silently teleports the player
- Client fades back in
- Night remains unskipped
- Actual:
- No fade effect occurs
- Teleport happens immediately in view
Thank you for taking the time to read and help!