Solved Create sign with permission

Discussion in 'Plugin Development' started by thefrooh, Nov 2, 2014.

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

    thefrooh

    Hey! I'm making one of my first plugins, it simply executes a command in console. But. I'd like to do it by the followings:
    -everyone can click the sign
    -but only those who has a specified permission can create signs like this
    -signs are "marked" by their first line: "[Something]"

    I have a working PlayerInteractEvent to sign click, but SignChangeEvent isn't working. Yes, I've registered it in my main class. So summing it up: If the sign's first line matches to a given string, AND if the player has a given permission, the sign can be created, and it makes some fancy stuff, like coloring..i know that, but if the player doesn't have the permission, and the first line matches, the sign.setType is AIR. How can I do that?
     
  2. Offline

    fireblast709

    thefrooh why not cancel the event? Or set the first line empty? (That way players won't lose signs). Anyway, you could get the block from the Sign and either use setType(Material) or breakNaturally(). If that doesn't work (as I don't have the source at hand atm, so I can't check if they force update the Sign), just schedule a 0 tick delayed task where you use setType() / breakNaturally().
     
  3. Offline

    Watto

    thefrooh

    Make sure the sign listener has @EventHandler above the method
     
  4. Offline

    thefrooh

    Solved with the help of my friends, thanks anyway!
     
Thread Status:
Not open for further replies.

Share This Page