Door Hooks

Discussion in 'Plugin Development' started by crowebird, Mar 2, 2011.

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

    crowebird

    Is there a specific hook for the placing of doors? Because I don't think it is triggered with block place (kind of like how pictures needs its own hook). Also is it possible to get a hook for left click on a door as a single trigger action, along with the block break hook? I say this because I can capture the STARTED tag on the block break, but it gets triggered more than once for some reason during the destruction of a door.
     
  2. Offline

    retsrif

    Placing: Listen for onBlockRightclick, the docs say it's for when a player attempts to place a block? Inside it check if the block is a door.
    Left click: onBlockInteract should do it.
     
  3. Offline

    crowebird

    left click does not fire onblockinteract. I found out why started gets fired more than once though. Since door breaking takes place on a half door level, if you move inbetween the top and lower part of the door, the hook gets fired again.

    forgot about onBlockRightClick :D
    --- merged: Mar 2, 2011 8:33 PM ---
    Alright so I can see onBlockRightClick, but how do I cancel the action?
    I am able to get my code to recognize a door on top of a block, but that does not comes after the event is first fired?

    onBlockRightClickEvent does not have a setCancelled event. The only way I can see to do this would be to create a time and check the block after a second and remove the action of the right click after the fact.

    Again door and pictures should be fired with onblock place imo.
     
  4. Offline

    retsrif

    Oh the multiple firing makes sense now... Left click doesn't fire it, though left clicking on a door, button, etc., should. Btw, try onBlockPlace instead of right click... Should work better :)
     
  5. Offline

    crowebird

    onBlockPlace is not fired by door placement, hence why I am looking for a new hook for doors, or a restructure of their current hooks :D
     
Thread Status:
Not open for further replies.

Share This Page