Get the ItemFrame a player is looking at.

Discussion in 'Plugin Development' started by woutwoot, Jun 16, 2014.

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

    woutwoot

    I'm currently looking for a way to display players information about what is in an ItemFrame for my ItemFrameShops plugin. I'm hoping to do this using the scoreboard and a repeating task, since I've allready used right click, crouch right click, left click and crouch left click.

    For this I will need to know which frame the player is looking at. I've found this: https://forums.bukkit.org/threads/find-blockface-player-is-targeting.145903/ which would allow me to get the itemframe, but I feel like there must be a more simple solution.

    Or is there any other way I could provide the user with the information? I don't want them to have to use a command.

    I'm still looking for a solution here :) Anyone? Any idea?

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

    Zupsub

    Use BlockIterator. For each block check if it's type is AIR then continue, otherwise it's the block the player is looking at.
     
  3. Offline

    woutwoot

    A ItemFrame is an Entity, not a Block.
     
Thread Status:
Not open for further replies.

Share This Page