Solved Sign not updating

Discussion in 'Plugin Development' started by 567legodude, Nov 15, 2014.

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


    I created a method to update any sign with a certain string on the second line.
    Can someone tell me why the sign doesn't update.
    1. public void sign(String s) {
    2. // Get location of sign
    3. Sign sign = (Sign) loc.getBlock().getState();
    4. if (ChatColor.stripColor(sign.getLine(1)).equalsIgnoreCase(s)) {
    5. sign.setLine(1, ChatColor.GOLD + ChatColor.stripColor(sign.getLine(1)));
    6. sign.setLine(2, ChatColor.WHITE + string);
    7. sign.setLine(3, ChatColor.DARK_PURPLE + otherstring);
    8. // It gets to here but the sign doesn't update.
    9. }
    10. }

    EDIT: I found that I could solve the problem using sign.update();
Thread Status:
Not open for further replies.

Share This Page