How to get the Block on which I'm looking but not fucusing ?

Discussion in 'Plugin Development' started by JoshuaBehrens, Apr 25, 2011.

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

    JoshuaBehrens

    Hey guys,

    I'm actually don't know how to get the block on which I'm looking (in the OnPlayerInteract-Event) without having fucused the block.
    Hope you can help me and thanks in advanced.

    Josh
     
  2. Offline

    Lolmewn

    You might want to use getBlockFase.
    Something like
    Block b = event.getBlockFace();
     
  3. Offline

    JoshuaBehrens

    I tried
    Code:
    event.getPlayer().getWorld().getBlockAt(event.getBlockFace().getModX(), event.getBlockFace().getModY(), event.getBlockFace().getModZ())
    but it does not work. And I don't think it could have worked. Anyone an other idea ?
     
  4. Offline

    Tempelchat

    Code:
    player.getTargetBlock(null, 100)
    Is it that what you are looking for?
     
  5. Offline

    JoshuaBehrens

    Yes. That's what I'm searching for. I tried to use it before, but I didn't know what to do with the first argument.
     
Thread Status:
Not open for further replies.

Share This Page