Solved getting type block behind button

Discussion in 'Plugin Development' started by dekrosik, Aug 27, 2015.

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

    dekrosik

    how to get block type behind button ?
    i have this
    Code:
            Block clicked = e.getClickedBlock();
            if (clicked.getType() == Material.WOOD_BUTTON || clicked.getType() == Material.STONE_BUTTON) {
                Button button = (Button) clicked.getState();
            }
    
    but how to get block behind this button?
     
  2. .getRelative(button.getAttachedFace())
     
    The_BloodHound likes this.
  3. Offline

    dekrosik

  4. Offline

    bling4525

  5. Offline

    dekrosik

    ok never mind im stupid (bad import)
     
  6. Offline

    bling4525

    happens to everybody
     
  7. I just tested it and it works perfectly for me:[​IMG]

    Maybe you imported java.awt.Button instead of org.bukkit.material.Button

    EDIT: Nvm, didn't saw that you solved it yourself already :p
     
  8. Offline

    au2001

Thread Status:
Not open for further replies.

Share This Page