How do I detect ANY dispenser that's been powered recently?

Discussion in 'Plugin Development' started by EpicBlargh, Nov 13, 2012.

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


    Is there an update event for that? I've searched a bit and I can't think of any method that would work at the top of my head.

    Thanks for any help!
  2. Offline


  3. Offline


    There's a BlockDispenseEvent.

    You should have a look at the docs, this is a pretty basic thing.
  4. Code:Java
    1. @EventHandler
    2. public void BlockDispense(BlockDispenseEvent event){
    3. if(event.getBlock().isBlockPowered()){
    5. }
    6. }
  5. Offline


    You don't even need to check that. If this event is fired, that means the dispenser was powered.
  6. i know but he wanted to check if it was powered
  7. Offline


    It was in the case the event was fired
  8. Offline


    except if the dispenser was triggered by a plugin.
  9. Offline


    My guess is you want to make a plugin to take a look for recent dispenser usages.s
    Since you probably care only about firing.

    • Create list of firings
    • If enabled, onItemDispense -> add location to list
    • Output this info via a command
Thread Status:
Not open for further replies.

Share This Page