Velocity icon indicating copy to clipboard operation
Velocity copied to clipboard

Player Loaded World API

Open Timongcraft opened this issue 8 months ago • 1 comments

With this PR, the in 1.21.4 introduced player_loaded packet can be utilised to send/display messages in-game without needing to guess when the player is actually in the world.

This PR only implements the part when the player joins a server, and not the respawn mechanic, this in my opinion makes sense as there's virtually no reason to fire stuff there on the proxy.

I'm not a fan of having to schedule a task for every player in 1.21.4+, though.

With the current implementation, the proxy waits 1500ms before the event fires as timed out, which is notchian/paper behaviour, but can be overridden using the velocity.loaded-world-timeout-override system property.

Fixes: #1466

Timongcraft avatar Apr 01 '25 15:04 Timongcraft

On another note. I think it could be a good idea to remove the timeout mechanism entirely, as plugins could create a similar mechanism by e.g. scheduling in the ServerPostConnectEvent and storing whether the loaded event triggered.

Edit: We could note that in the javadoc if desired

Timongcraft avatar Oct 09 '25 20:10 Timongcraft