Piston Events

Discussion in 'Plugin Development' started by Reteckz, Apr 12, 2013.

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

    Reteckz

    Hello.

    I need some help with piston events badly, as I can't get them to work.
    It should return; when the moved blocks or pulled block is a Sponge.
    I tried my best, but it kept bugging out, so I came here to ask you guys for help :3

    Thank you!

    ~ Reteckz
     
  2. Offline

    crushh87

  3. Offline

    skore87

    This won't cover all aspects of a piston but should help you understand what direction you need to start looking in. Hint: the piston may still pull the block.

    Code:
    @EventHandler
    public void herpderp(BlockPistonEvent e){
    if (e.getBlock().getRelative(e.getDirection).getType == Material.SPONGE)
    e.setCancelled(true);
    }
     
Thread Status:
Not open for further replies.

Share This Page