brokiem / SimpleLay

🪑 PocketMine-MP Plugin which allows to Sit or Lay on the Ground!
GNU General Public License v3.0
18 stars 12 forks source link

Laying optimisation suggestion #13

Open inxomnyaa opened 3 years ago

inxomnyaa commented 3 years ago

By using the bed sleeping mechanic, you can not rotate the model, and sometimes it gets offset.

I suggest using the AnimateEntityPacket with the "sleeping" animation

$animation = 'animation.player.sleeping';
$animpk = AnimateEntityPacket::create($animation, "", "", "", 0, [$e->getId()]);
Wertzui123 commented 2 years ago

How would I rotate the player using the animate packet?

inxomnyaa commented 2 years ago

Like literally how i wrote it.

Wertzui123 commented 2 years ago

The code you sent only allows to me lay in one direction, which makes sense since I don't specify any rotations in the packet.

inxomnyaa commented 2 years ago

Iirc that depends on the player's rotation

Wertzui123 commented 2 years ago

I've tested it yesterday and I think always lay in the same direction, no matter where I was looking when starting the animation.