Backstab

Discussion in 'Plugin Development' started by Areoace, Jan 15, 2014.

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

    Areoace

    Would someone be able to assist me with backstab? I know how it works kinda I just dont know how to pull it off
     
  2. Offline

    se1by

    Check EntityDamageByEntityEvent, then check if the player can backstab (e.g. is he a spy?).
    Then check if the directions match. If they do, add damage / kill the enemy / whatever.
     
  3. Offline

    Areoace

    Would you be able to show me how is what I meant >.<
     
  4. Offline

    Syd

    You should specify you question. What exactly do you want to know?
     
  5. Offline

    Areoace

    I want to know how to check if the damager is behind the target (backstabbing) so it can deal additional damage
     
  6. Offline

    SmellyPenguin

    You're going to have to do a couple of calculations using both of the player's yaws.
     
  7. Offline

    Syd

    Code:java
    1. victim.getLocation().getDirection().angle(attacker.getLocation().getDirection()) * 180 / Math.PI


    This line will get you the angle in degrees.

    You could take a look in existing, open source, plugins, that offer backstab or backstab like features. :)
     
Thread Status:
Not open for further replies.

Share This Page