Make a player swing arm

Discussion in 'Plugin Development' started by BloodShura, Apr 7, 2012.

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

    BloodShura

    Hi.

    How can I do something to make the player swing his arm? It's, animate his arm?

    I tried:
    Code:
      EntityPlayer p = ((CraftPlayer)player).getHandle();
     
      ((WorldServer)p.world).tracker.a(p, new Packet18ArmAnimation(p, 1));
    But no results (no errors). I tried also:
    Code:
      PlayerAnimationEvent evt = new PlayerAnimationEvent(player);
     
      Bukkit.getPluginManager().callEvent(evt);
    But doesn't work too (no errors too).

    Any ideas?
    Thanks.
     
  2. Offline

    Taco

    Try this:

    Code:
      EntityPlayer p = ((CraftPlayer)player).getHandle();
    p.netServerHandler.sendPacket(p, new Packet18ArmAnimation(p, 1));
    The second chunk of code you had is only shooting out an event to other plugins saying that the player in question swung their arm, so it won't force the animation.
     
  3. Offline

    BloodShura

    Hmm, yea, it works, but don't works. LOL?

    I tried to do something to bypass the cheat 'NoSwing', automatically making the player swing arm on BlockDamageEvent, but it's like the hack prevent this. :/

    But yea, I finded another way to prevent the noswing without animating the arm, so it's okay.

    Thanks.
     
  4. Offline

    Colecf

    What was it??

    Stating your answer helps others. (like me)
     
  5. Offline

    Tauryuu

    How did you do it? Mind sharing? :3
     
Thread Status:
Not open for further replies.

Share This Page