Prevent Piston Affecting Doors

Discussion in 'Plugin Development' started by WiseHollow, Oct 30, 2013.

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

    WiseHollow

    How to I make it to where a Piston cannot push a door?

    It seems that it's a lot harder than it sounds considering the difficulty I've had with it. XD But if someone can prove me wrong on that, I'd be delighted!
     
  2. Offline

    TheUpdater

    is there an event for pistonmove?
     
  3. Offline

    WiseHollow

    TheUpdater

    Indeed there is Good Sir. I use, "BlockPistonExtendEvent".
     
  4. Offline

    TheUpdater

    good =)
     
  5. Offline

    WiseHollow

    TheUpdater
    But, it isn't as simple as knowing what event to use xD

    bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  6. Offline

    xTrollxDudex

    WiseHollow
    PHP:
    for(Block b event.getBlocks()){
        if(
    b.getType() == Material.DOOR){
            
    event.setCancelled(true);
            break;
        }
    }
     
  7. Offline

    WiseHollow

    xTrollxDudex
    This is what I tried already, and it doesn't work.
     
  8. Offline

    xTrollxDudex

  9. Offline

    WiseHollow

    xTrollxDudex
    I could try again once I get off work today. Have you tried this?
     
  10. Offline

    lzravanger

    I would check your materials. Material.DOOR may be the in hand item. Test this with other blocks like stone and see if it works in that scenario.
     
  11. Offline

    WiseHollow

    lzravanger "Hand Item"?
     
Thread Status:
Not open for further replies.

Share This Page