Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Players can collect drop while waiting respawn after death #669

Closed
VladOliinyk opened this issue Feb 12, 2023 · 2 comments
Closed

Players can collect drop while waiting respawn after death #669

VladOliinyk opened this issue Feb 12, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@VladOliinyk
Copy link

Describe the bug
After a player dies, he becomes in ~spectator mode and flies for a few seconds while waiting for respawn.
And if during this time the player flies up to a resource spawner (emeralds or diamonds) ((or any other drop that might be on the ground)), the player can pick it up BEFORE respawning.

It feels like when respawning the player FIRSTLY becomes "a player" (from ~spectator mode to survival mode), and then teleports to his spawn. And just between the time when the player is "alive" and before he is teleported to his spawn - he picks up that drop.
Video: https://youtu.be/8N__Jl4EcBI

To Reproduce
Steps to reproduce the behaviour:

  1. Make sure the emeralds or diamond has drop, (or there are any other drop near the spectator-spawn point)
  2. Make sure your bed are not destroyed (obviously)
  3. Die (as a player)
  4. While respawn-counter, fly as fast as possible to the drop on a ground
  5. Wait for respawn and you'll respawn with items picked up.

Expected behaviour
The player who is waiting for respawn in spectator mode can not pick up drop while respawning :)

I guess it could be solved just by changing the order of the events:

  • first: tp player to his spawn point,
  • second: change player mode from spectator to survival

Screenshots
Video: https://youtu.be/8N__Jl4EcBI

System (please complete the following information):
Plugin version: 23.1.1
serverType: SHARED
Waterfall and pufferfish backends (not sure its versions matter.

@VladOliinyk VladOliinyk added the bug Something isn't working label Feb 12, 2023
@tomkeuper
Copy link
Collaborator

I put the code that removes the respawnSession protections (eg. picking up items) inside a short delay making sure that the protection gets removed after the player has been teleported, as this is done async.

@VladOliinyk
Copy link
Author

Yep! Сan confirm, fixed! (in the snapshot you sent)
waiting for the release <3
Thanks

@andrei1058 andrei1058 mentioned this issue Feb 26, 2023
andrei1058 added a commit that referenced this issue Feb 26, 2023
New features:
- Added {prefix} support to all messages
- Added unformatted player names for kill and bed destroy message
- Added unbreakable to mellee weapons #245
- Addded Elytra auto equip #663
- add toggle for halloween special (#632)
- Added Placeholders to upgrade message #668

For developers:
- add sidebar init event
- exposed sidebar to the API

- fix team identifier length (Sidebar kick issue (#682, #666 )
- Fix Moneys reward team-support on Solo & update variables names
- Bug fixes and placeholder adjustments (#685)
- Fixed command error when lobby location is not set
- Fixed spanish translation error #599
- Fixed spanish translation error #599
- Netherite armor support in 1.16+ #657
- Wins placeholder not in lobby sidebar #658
- Sidebar Title animation not working #660
- Player levels showing numbers #661
- Fixed In-game arena Scoreboard lines in the wrong spot #662
- NPE when clicking outside of shop inventory #664
- Added Placeholders to upgrade message #668
- Fixed players can collect drops during respawn #669

---------

Co-authored-by: Tom Keuper <[email protected]>
Co-authored-by: Yuri <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants