Check if OP placed sign? (Adding unique property to placed sign block)

Discussion in 'Plugin Development' started by Froshin, May 28, 2013.

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

    Froshin

    Hi!

    I want to add some sort of property to a block that is activated when an OP places down a sign with a certain string in the first sign line.

    I have no problem with the first sign line part, but I'm unsure to which property I should add. I did make the text bold through ChatColor, but there seems to be no quick way to check this.

    Sure, it could probably work with something like

    if(!(ChatColor.stripColor(sign.getLine(0).equals(sign.getLine(0))))), (I didn't try it as I came up with this now), but is there a more efficent way? I do not want hacker to be able to create signs with this property, because the signs should only ever exist in certain locations.


    Thanks in advance!
     
  2. Offline

    ZachBora

    I would go with the easy way, if a non op tries to make a bold sign you cancel the placement.
    In the harder way, you could store the signs in a file or something.
     
Thread Status:
Not open for further replies.

Share This Page