Solved Get Face From a Distance?

Discussion in 'Plugin Development' started by Elimnator, Sep 28, 2013.

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

    Elimnator

    When a player interacts is there a way to get the block face their cursor is over, even if is is like 20 blocks away? I know I can get the block their cursor is over, but I need to get the face.

    Anyone?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  2. Offline

    ZapChance

    I don't think this is possible within the Bukkit API, but I bet that if you can get the direction the player is looking, you can have the system "assume" it's looking at that face.
     
  3. Offline

    Elimnator

    Is there a way to get the block beside the interacted block in the direction of the player? (Even diagonal)
     
  4. Code:java
    1.  
    2. Block b = player.getTargetBlock(null, 20);
    3. int data = b.getData();
    4.  


    this returns a integer. And also is deprecated.
    But you could prob make a little thing with all the direction names like

    String[] woodDirection = { "stuff", "stuff2" };
     
  5. Offline

    Elimnator

    I got it, I just got the blocks beside the clicked block, and I checked which one was closer to the player.
     
Thread Status:
Not open for further replies.

Share This Page