Grab opposite blockface direction of sign

Discussion in 'Plugin Development' started by CullanP, Apr 1, 2015.

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

    CullanP

    I'm using playerinteractevent and I have it so when they right click the sign it will make a chest and take money, great. Everything is working, I even know how to set the blockface of the chest already, I just don't know how I can get the opposite face the player has when right clicking the sign. If you need an example, I would want a chest direction to be this way when right clicking the sign, any help would be much appreciated

    [​IMG]
     
  2. @CullanP
    So you want the direction of the chest to be south when the signs direction is north?
    Then there is no other way, then using if statements like this (Please be aware, this is Pseudocode):
    Code:
    if (signDirection == North) {
        chestDirection = South;
    } else if (signDirection == East) {
        chestDirection = West;
    }...
     
  3. Offline

    mine-care

  4. Offline

    CullanP

    I don't understand how this helps me. If it was this simple I woudn't need help. Sign directions by default are self, which makes it difficult to get anything other then self out of a sign. I've tried using snippets of code using yaw, but it never wants to work for me.
     
  5. @CullanP
    you can get the clicked Blockface from the PlayerInteractEvent, so just use:
    Code:
    e.getBlockface().getOppositeFace()
     
  6. Offline

    CullanP

    That won't work with a sign. As I said, A sign's blockface is SELF by default.
     
  7. @CullanP
    Well you could probably try using some raycast trickery...
     
Thread Status:
Not open for further replies.

Share This Page