Getting damage Locations?

Discussion in 'Plugin Development' started by MoeMix, Jun 9, 2014.

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

    MoeMix

    Hey bukkit! I'm going to cut to the chase, is it possible to get the damage location of an entity? Is there some sort of method for it or would I have to use some spacial mathematics?

    For example: I want a giant zombie to die only if it was hit on the back of its neck. But how would I check where the entity was damaged?

    Thanks,
    -Moe
     
  2. Offline

    Gater12

    MoeMix
    Maybe dealing with the Player's Yaw/Pitch probably?
     
  3. Offline

    MoeMix

    Gater12
    I don't see how the players angle could help in determining the position of damage on the entity. Could you explain just a bit further?
     
  4. Offline

    Gater12

    MoeMix
    Yaw/Pitch is where the cursor is pointed at.
     
  5. Offline

    MoeMix

    yes but how would I check if the cursor is pointed at the back of the neck? That was the main issue.
     
  6. Offline

    bigteddy98

    I think you could do something cool here with the Y location. Compare the location of the player.getEyeLocation().getY() with the location of the zombie's feed + (height from feet to neck). Also check if the Y isn't too big. You could check out this.
     
Thread Status:
Not open for further replies.

Share This Page