Replies: 13 comments
-
Not sure about a event like this to "solve a issue" |
Beta Was this translation helpful? Give feedback.
-
Something like |
Beta Was this translation helpful? Give feedback.
-
This seems like something that could be easily fixed by just having the plugin keep track of the last world a player was in itself (using the PlayerChangedWorldEvent and some data storage). So I'm not really convinced that this needs to be an API addition. A config option on the other hand could be useful to avoid needing a plugin specifically for this. |
Beta Was this translation helpful? Give feedback.
-
A little later I also thought about it, but we already have a lot of players who quit in worlds that no longer exist. We don't know their names, but we know that they are exist.. So this "fix" will work for "new" players only :(
Or just tp the player to overworld spawn by default, instead of changing his world and keeping at the same coordinates. It seems to me more logical, safe (for player) and predictable.. |
Beta Was this translation helpful? Give feedback.
-
Another alternative solution: Add nullable |
Beta Was this translation helpful? Give feedback.
-
Paper already has a patch that is supposed to take care of this, is it not working? https://github.com/PaperMC/Paper/blob/f8c01122e69ce1f7681e6bc2b8e280ce807167df/patches/server/0384-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch |
Beta Was this translation helpful? Give feedback.
-
@Jikoo, it doesn't move player to spawn point, it move player to the spawn world to the same position he was in unloaded world. That position may contain lava or may be located under ground, and player will just die for example due to suffocation. There's currently no way to avoid/control this. |
Beta Was this translation helpful? Give feedback.
-
Then the patch isn't working. It's supposed to move the player to their spawn if available or the default spawn if the world they're in is nonexistent. More accurately, the patch specifically just leaves it to MC to figure out what to do about a null world instead of doing the Craftbukkit thing and moving them to the default world at their current coordinates. Maybe default MC behavior has changed. |
Beta Was this translation helpful? Give feedback.
-
It does appear the description of that patch does not match the behavior. If that bug is fixed would you still need this API? I feel like it will become rather irrelevant then. |
Beta Was this translation helpful? Give feedback.
-
If the question is for me, then after all that I wrote earlier, I don't quite understand what bug you are talking about.. Everything that is described here is still a problem, at least for me. |
Beta Was this translation helpful? Give feedback.
-
Hmm with https://github.com/PaperMC/Paper/blob/master/patches/server/0373-Don-t-move-existing-players-to-world-spawn.patch and https://github.com/PaperMC/Paper/blob/master/patches/server/0384-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch maybe i understand what happen.... i test editing the last patch for handle the method used in the first patch for handle the spawn position only when the world was change (in teory when the world its not found) if works then can open a PR... |
Beta Was this translation helpful? Give feedback.
-
I don't think so. In case a plugin was installed after deleting a world, it just won't know what world a player was in last time. |
Beta Was this translation helpful? Give feedback.
-
I think an event for this is a good idea, and once #9887 is merged, an event will be easy to add on top of it. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem?
Yea, our players sometimes gets stuck in blocks (in main overworld at same position where they were in the other world) and then die due to suffocation :/
This happens only if the server was restarted and the other world's folder (created by plugin or vanilla nether/the end) was deleted.
Describe the solution you'd like.
Add
PlayerSpawnInUnknownWorldEvent
(or something with better name) that gets called if player joining the game and the server can't find the world this player was in before.That event contains
#setSpawnLocation(Location)
and nullable#getSpawnLocation()
. By default thatLocation
isnull
to keep existing behavior. If no one plugin changed thisLocation
, then this player will spawn in overworld at same position (current behavior), otherwise the server will use thatLocation
to spawn this player at.Describe alternatives you've considered.
idk. I'm tried
PlayerSpawnLocationEvent
but it gets called with default world/overworld in this case, so plugins cannot determine exactly which world the player was in before.Other
No response
Beta Was this translation helpful? Give feedback.
All reactions