Getting the Attack-side

Discussion in 'Plugin Development' started by ServerfromMinecraft, Sep 21, 2012.

Thread Status:
Not open for further replies.
  1. Hi!

    How i can get the side where the player is attacked? also so:

    I= player O= block i = monster

    I<i
    OO
    that its return the red O
     
  2. Offline

    ferrybig

    you can calculate it from the yaw and pitch from the attacker
     
  3. Ok! but...how?

    Ok, now i have try it so, but nothing happens:
    Code:
    if(locdmg.getX() > loc.getX()){
    loc.getBlock().getLocation().add(1,0,0);
    }else if(locdmg.getX() < loc.getX()){
    loc.getBlock().getLocation().add(-1,0,0);
    }else if(locdmg.getZ() > loc.getZ()){
    loc.getBlock().getLocation().add(0,0,1);
    }else if(locdmg.getZ() < loc.getZ()){
    loc.getBlock().getLocation().add(0,0,-1);
    }
    anyone has a idea :( ?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
Thread Status:
Not open for further replies.

Share This Page