Powering redstone linked to signs

Discussion in 'Plugin Development' started by Bauer, Jan 26, 2011.

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

    Bauer

    Is it possible to have code that reads data from a sign, and if the 1st line contains X then it will output a redstone signal?

    If so, how do you do this?
     
  2. Offline

    mjmr89

    I'd imagine you'd start with the BLOCK_PLACE event and seeing #1, if the block is a SIGN or SIGN_POST, then find out if the 1st line contains X. If so, check if the blocks around the sign are an instance of redstone (if b is a block object, "b.getState() instanceof Redstone" in the if line). If it is, set it to the powered state.

    Then, on the BLOCK_DAMAGE event (I'm not sure if theres a block_destroyed event) check if its destroyed and a sign/signpost, and it contains an X, set it to unpowered.

    If that makes sense. I'm pretty sure someone else knows how to do it more efficiently, but that's how I'd do it :).
     
  3. Offline

    Bauer

    Thanks, I'll read up on some of the things you mentioned.
     
Thread Status:
Not open for further replies.

Share This Page