BetterChairs icon indicating copy to clipboard operation
BetterChairs copied to clipboard

Add a /lay command

Open SecretlyJealous opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. I apologise if what I'm about to suggest is outside the scope of this plugin, but I was wondering if /lay could be implemented? There are a few other plugins that have /lay but they also come with their own /sit. I would prefer to use this plugin for /sit while also being able to use /lay.

Describe the solution you'd like A /lay command

Additional context For example a plugin called gsit has a /lay command: image

SecretlyJealous avatar Jul 25 '22 18:07 SecretlyJealous

I did some testing and some research and this looks like a somewhat complicated matter – Especially in newer version (I tested in 1.19.2).

In case somebody wants to PR this or do some additional research:

  • Apparently older Minecraft versions just have a Bed-Packet that can be send to everyone to fake the sleep animation
  • There is ServerPlayer#startSleeping but it requires a bed (client side only?)
    • Maybe the coordinates of the bed do not have to match the player's?
  • There is the ClientboundSetEntityDataPacket-Packet that might be used to send a Pose.SLEEPING
    • Has to be sent to all players that should see the given player/entity sleeping

SpraxDev avatar Aug 24 '22 14:08 SpraxDev