Bukkit send player "Bow Drawback Packet"?

Discussion in 'Plugin Development' started by Mr Burkes, Jun 14, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Mr Burkes

    My question is basically in the title, but is there a packet sent when the player draws back a bow? My goal is to get that animation to play without the player actually holding a bow. You've all seen it; the one where both of the players arms are stretched out in front of them when they're charging a bow? Has anyone been able to do this yet? Is it possible?
     
  2. Offline

    chasechocolate

    AFAIK it is handled client-side.
     
  3. Offline

    Mr Burkes

    How? All players see the animation.
     
  4. Offline

    Kainzo

    That's a good point, but still could still be client..
     
  5. Offline

    Comphenix

    But what matters is how the server instructs the client to display that animation - indirectly, by telling it a player has right-clicked on an item, or directly by sending a play animation packet.

    Unfortunately, like a lot of places in the protocol and for little good reason, it's the former. The server sends an ENTITY_METADATA (40) packet setting the 4th bit in the flag metadata that indicates the player referenced in the packet is performing a right-click action. When the player releases the bow, a new packet is sent to clear this bit.

    Nowhere in this packet is an animation type or item type specified - this is decided on the client-side depending on what item the client believes the player is holding. So, no, you can't play the bow animation without also displaying the bow. You would have to use a client-mod such as SpoutClient to achieve that (assuming it supports it).
     
    glen3b likes this.
Thread Status:
Not open for further replies.

Share This Page