Get the block a wall sign is placed on?

Discussion in 'Plugin Development' started by Xx_LeetGamer_xX, Aug 6, 2013.

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

    Xx_LeetGamer_xX

    How can I get the block that a wall sign is placed on?
     
  2. Offline

    adam753

    I found this after some searching.
    Code:
    if (block.getType() == Material.SIGN_POST || b.getType() == Material.WALL_SIGN) {
      Sign s = (Sign) block.getState().getData();
      Block attachedBlock = b.getRelative(s.getAttachedFace());
      // ...
    }
    
     
  3. Offline

    moo3oo3oo3

    It's not working.
     
  4. Offline

    adam753

    @moo3oo3oo3
    Did you really need to necro-post two threads with this issue? If your code isn't working just make a new thread, post it and say what the problem is. (I mean, you can do that here if you want, but necro threads tend to get locked.)
     
Thread Status:
Not open for further replies.

Share This Page