[Solved]How would I go about making a player appear to be sitting?

Discussion in 'Spigot Plugin Development' started by Ygx, Jul 10, 2015.

  1. Ygx


    I am trying to make a very simple plugin: When a player types the /sit command they will have a sitting animation. As soon as they move the animation goes away. The moving part is not what I am stuck on: How do I make the player have the sitting animation? I know I would have to send a packet. If you could link me to a tutorial on packets or something similar I would appreciate it.
    #1 Ygx, Jul 10, 2015
    Last edited: Jul 10, 2015
  2. I don't think you can send the animation alone. You must have the player mounted on an entity.
  3. Ygx


  4. With NMS, or you can try giving it the invisible potion effect (may create those swirly particles, though).
  5. Doesn't ProtocolLib have a PacketPlayOutSit (Or something close to that name) That you could use instead of spawning invisible Entities and having to worry about cleaning them up later?
  6. Probably. But then you would have to worry about resending that packet to every player, even the ones that arent on screen at the time of performing the action that end up walking into the area, etc etc. Much easier to track the arrow than to track a bunch of players that may or may not come into viewing range of the sitting player.
  7. Good point, I didn't think about that.