Solved EntityDamageEvent not being changed (Packet problem)

Discussion in 'Plugin Development' started by kameronn, Sep 20, 2016.

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

    kameronn

    The problem is im setting custom damages through entity damage event but it wont work, because now im using async hit detection, and it's not being change.
     
    Last edited: Sep 21, 2016
  2. Offline

    kameronn

    bump
    (im using protocollib)
     
  3. Offline

    HeartandSoul

    Paste your full code.

    And if you're trying to set custom damage, create a Sync runnable (Sorry for memory leaks and Nooby use of java Packets), and then create a method below it. Call the Event method in your runnable... and Don't put it in your runnable.
    org.bukkit.event.entity.EntityDamageEvent#setDamage();
     
  4. Offline

    kameronn

    @HeartandSoul Fixed it, I was being an idiot, the problems were that I was checking if they were on the ground and their Y velocity is more then 0 then it will be registered and did an else event for the critical, but if you're not jumping your Y velocity will be 0 and therefore wont pass the if statement.

    The second problem was with my async packet sending, I used Syncstart(); instead of start(); and as for the knockback, I send a velocity packet to the user (not protocllib) and canceled the velocity event if the last attack was instanceof player (i know not the best way)
     
Thread Status:
Not open for further replies.

Share This Page