Getting second target block / getting the next target block behind the first target block

Discussion in 'Plugin Development' started by Wituz, Apr 15, 2013.

Thread Status:
Not open for further replies.
  1. I know that player.getTargetBlock(transparrent block hashset, distance) will return the specified block the player is targeting inside of the specified range. I'm just wondering how to get the second target block.

    For example, lets say that
    :D = player
    | = Target block
    || = Second target block (What i need to know what is)

    And the scene looks like this:
    :D -> | ||
    (player looking -> that way)

    Any clever heads that can figure out how to do this?
     
  2. Offline

    chasechocolate

    You could first get the target block, set it's ID in a Set<Byte>, and get the target block again using the Set.
     
  3. But .. what if the target block's ID is larger than what the data value "byte" supports? I see at this link that some block's id are larger than 127, which is the max. value of a byte in java :)
    Thank you for answering quick :)
     
  4. Wituz likes this.
Thread Status:
Not open for further replies.

Share This Page