Get the block in front of a player

Discussion in 'Plugin Development' started by PieMan456, Dec 10, 2013.

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

    PieMan456

    Hello Everyone,

    I am just wondering how to get the direction the player is looking and to get the block in front of the player.
     
  2. Offline

    beastman3226

    Location.direction(). Check the javadocs.
     
  3. Offline

    NathanWolf

    A BlockIterator can also be used to easily get the block in front of the player. I think the getLineOfSight method is deprecated, but that could do it, too.
     
  4. Offline

    PieMan456

  5. Offline

    NathanWolf

  6. Offline

    PieMan456

    NathanWolf
    I need a location for it so would I use the players location? And how would I get only one block instead of 4?
     
Thread Status:
Not open for further replies.

Share This Page