[SPIGOT-6316] PlayerBedLeaveEvent implements Cancellable Created: 15/Jan/21 Updated: 30/Jan/21 Resolved: 29/Jan/21 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | New Feature | Priority: | Minor |
Reporter: | lukas of lockless | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | event | ||
Environment: |
api server |
Attachments: |
![]() |
Version: | 1.16.4 |
Guidelines Read: | Yes |
Description |
PlayerEntersBedEvent can be cancelled and has a very informative interface getBedEnterResult() im attaching a plugin to let those interested see what happens when a player enters a bed during the daytime. the plugin does system.out.println some information about the events. i hope i didn't mess up following the guidelines or add this in the wrong place. |
Comments |
Comment by lukas of lockless [ 30/Jan/21 ] |
this is incredibly informative. thank you for the reply. |
Comment by md_5 [ 29/Jan/21 ] |
I see, thanks. There was an issue with my previous testing. |
Comment by David Mayr [ 28/Jan/21 ] |
That is wrong. You can sleep on the day and indeed cancel the sleep stop on the server side. Sending a Sleep Packet during the day puts the player in the bed and keeps him there. The Server does indeed kick him when using .sleep though since it is day but when the Server knows nothing about the player sleeping it works. And strictly ignoring the Client Command Packet with the Type Stop Sleep keeps the player in the bed, and he is unable to leave even with the Button. |
Comment by md_5 [ 27/Jan/21 ] |
Cancelling is problematic on the client side, since the client leaves the bed before notifying the server |