Get target ItemFrame (=! Block) getTargetEntity()

Discussion in 'Plugin Development' started by woutwoot, Feb 18, 2013.

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

    woutwoot

    What I need is something like this (distance not necessary) : player.getTargetBlock(transparent, maxDistance) but for ItemFrames. Can someone help ?
    If it would help, I only need the location of the ItemFrame the player is looking at.

    Before someone says so, if found this: http://forums.bukkit.org/threads/gettargetentity-something-like-this.59837/
    But it gave me NullPointerException.

    Please help.
     
  2. Offline

    tkausl

    Code:java
    1. Block block = player.getTargetBlock(null, 100);
    2. if(block instanceof ItemFrame){
    3. ItemFrame frame = (ItemFrame) block;
    4. }


    This doesnt work?
     
  3. Offline

    woutwoot

    That's to get a block. Doesn't work with ItemFrame because that's an Entity.
     
Thread Status:
Not open for further replies.

Share This Page