Get player in another player's direction

Discussion in 'Plugin Development' started by HamOmlet, Oct 28, 2012.

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

    HamOmlet

    I'd like to check if a player is directly in another player's direction. I'm also checking if the players are within a certain distance from each other, but the code I currently have works. Below is an example of what I'm looking for:
    Code:
    if(playerA.getLocation().distance(playerB.getLocation()) <= 2.0d && 'is in player's direction') {
      //code
    }
    I know there's a .hasLineOfSight method, but the player need to be directly in front of the player. Any help?
     
Thread Status:
Not open for further replies.

Share This Page