Sign click event.

Discussion in 'Plugin Development' started by TotallyNotWalshy, Sep 26, 2014.

Thread Status:
Not open for further replies.
  1. So I want to check when the player right clicks a certain sign. I debugged it and the line below is the issue, I can't seem to figure out the issue please help.

    Code:java
    1. if(e.getClickedBlock().getType().equals(Material.SIGN)){
     
  2. Offline

    AronTheGamer

    Material.SIGN is just the thing you can hold in your hand.

    Check for SIGN_POST and WALL_SIGN
     
    Nateb1121 likes this.
  3. AronTheGamer Ok now just this one
    Code:java
    1. Sign sign = (Sign) block.getState();
    2. if(sign.getLine(0).equalsIgnoreCase("[Upgrade]")){
    3. System.out.println("DEBUG 5");
    4. }

    The debug does not get printed.
     
  4. bump (Not full 24 hours but it's the next day, and this was on the second page)
     
  5. Offline

    tommyhoogstra



    Code:java
    1.  
    2. if (e.getClickedBlock().getState() instanceof Sign) {
    3.  
    4.  
    5. Sign s = (Sign) e.getClickedBlock().getState();
    6.  
    7. if(s.getLine(0).contains("[Upgrade]")){
    8. //do
    9. }
     
  6. Offline

    fireblast709

Thread Status:
Not open for further replies.

Share This Page