Return a the block a sign is attached to -> Best way?

Discussion in 'Plugin Development' started by TobyZ28, Oct 20, 2012.

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


    Hey all, i'm trying to determine the block a WALL_SIGN is attached to. I can manually code this using a switch statement on the sign data value, but I'm pretty sure there is a more elegant solution. I noticed there is a BlockFace enumerable and such. Looking at some google cached javadoc's i thought this would work to return me the Block Face of the Sign:
    Sign mySign = (Sign)myBlock.getState();
    BlockFace myBF = mySign.getAttachedFace();

    However the getAttachedFace() method doesnt seem to be available for my sign object. Any idea's on what i'm doing wrong, or better yet any solutions on how to efficiently do this? :)

    Found a solution!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 29, 2016
Thread Status:
Not open for further replies.

Share This Page