Solved ProtocolLib - Packet Listener's Magic

Discussion in 'Spigot Plugin Development' started by LunyashaRu, Jun 2, 2017.

Thread Status:
Not open for further replies.
  1. This way it works. But this way it doesn't. I wasted about two hours in trying to fix this, but i couldn't. So, why a packet need a cooldown to send? Thanks.
     
    #1 LunyashaRu, Jun 2, 2017
    Last edited: Jun 2, 2017
  2. Can you explain the differences in the code?
     
  3. Oh, sorry, wrong link. Fixed.
     
  4. Ran on a corrupt JVM???
    I use Thread.sleep(cooldown);
    an asynchronous thread/bukkit task
     
  5. It's because you send the packet ENTITY_METADATA within the PacketEvent for ENTITY_EQUIPMENT. So the client recieves the ENTITY_METADATA packet before they get the EQUIPMENT packet and for the client to make the bow draw animation, the player needs to have a bow in their hand. So that is why the delay is necessary.
     
    • Informative Informative x 1
Thread Status:
Not open for further replies.