Solved Check when a Player swings their arm (ProtocolLib)

Discussion in 'Plugin Development' started by CommonSenze, Jun 18, 2018.

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

    CommonSenze

    Hello all,

    As it says above, I am trying to receive when a player left clicks and he swings his arm. Here's my code:
    Code:java
    1.  
    2. ProtocolLibrary.getProtocolManager().addPacketListener(
    3. new PacketAdapter(plugin, ListenerPriority.NORMAL,
    4. PacketType.Play.Client.ARM_ANIMATION) {
    5. @Override
    6. public void onPacketReceiving(PacketEvent event) {
    7. EntityUseAction action = event.getPacket().getEntityUseActions().readSafely(0);
    8. if (action == EntityUseAction.ATTACK) {
    9.  
    10. }
    11. }
    12. });

    Now, I've tried many changes to this, spending up to 2 hours on this problem, but I can't seem to figure it out. In replacement of
    Code:java
    1. getEntityUseActions()
    I've tried
    Code:java
    1. getIntegers()
    Code:java
    1. getPlayerInfoActions()
    Code:java
    1. getPlayerActions()
    Code:java
    1. getBytes()
    Code:java
    1. getPlayerDigTypes()
    Code:java
    1. getEntityModifier(World world)
    Code:java
    1. getEntityModifier(Packet event)
    Code:java
    1. getCombatEvents()
    and
    Code:java
    1. getByteArrays()
    but all seem to be 0 in size.

    Thank you very much in advanced!

    Double post to renew its relevance. I really would like help with this.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 18, 2018
  2. Offline

    MightyOne

    So what is your problem?
     
  3. Offline

    CommonSenze

    @MightyOne
    I abandoned the idea in total. It turns out it doesn't send any information. Just receiving the packet itsself. Apologize for the troubles.
     
  4. Offline

    MightyOne

    At least you know how to deal with packages
     
  5. Offline

    CommonSenze

    @MightyOne
    It's crazy because I knew nothing about packages before half way into May
     
  6. Offline

    MightyOne

    any good examples/tutorials, anythig one would be interested in trying out because it seems useful?
     
  7. Offline

    CommonSenze

  8. Offline

    MightyOne

Thread Status:
Not open for further replies.

Share This Page