preventing a block from being pushed by a piston

Discussion in 'Plugin Development' started by CaiusTSM, Nov 8, 2011.

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

    CaiusTSM

    Hi, how would I prevent a block from being pushed by a piston? (the event?)
    Any help would be appreciated, thanks.
     
  2. Offline

    AndrewM16921

    In a block listener,

    Code:
    public void onBlockPistonExtend(BlockPistonExtendEvent event)
    {
      if(...)
        event.setCancelled(true);
    }
    
    public void onBlockPistonRetract(BlockPistonRetractEvent event)
    {
      if(...)
        event.setCancelled(true);
    }
    
    and register the events for this listener
     
Thread Status:
Not open for further replies.

Share This Page