Stop a block from updating?

Discussion in 'Plugin Development' started by Dreeass, May 5, 2012.

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

    Dreeass

    I'm making a plugin so when a block is next to another block specified it changes to another block but when using a for example a redstone lamp that is powered it unpowers itself after changement. Is there any way of keeping it a powered redstone lamp?
     
  2. Offline

    Dreeass

    Really no one? I read some stuff with .isPowered() and other stuff but they aren't working. :/
     
  3. Offline

    Craftiii4

    Code:java
    1. @EventHandler
    2. public void onBlockRedstone(BlockRedstoneEvent event) {
    3.  
    4.  
    5. String test = event.getBlock().getType().toString();
    6.  
    7. if (event.getBlock().getType() == Material.REDSTONE_LAMP_ON) {
    8. event.setNewCurrent(100);
    9. }
    10.  
    11.  
    12. }
     
  4. Offline

    Dreeass

    Thanks, it works but what does the 100 stand for?
     
  5. Offline

    Sorroko

    Dreeass I believe it just fakes a redstone current for 100 ticks (20 ticks is roughly 1 second)
     
  6. Offline

    Craftiii4

    Im not sure tbh ^^, but i was by it for more than 10 sec and it was on through out all of it, (but my local-host is very slow XD)
     
  7. Code:
    event.setNewCurrent(15); 
    This sets the redstone to it's maximum powered state, you can conclude the rest.
     
Thread Status:
Not open for further replies.

Share This Page