Solved BlockBurnEvent not firing

Discussion in 'Plugin Development' started by bdubz4552, Jun 9, 2014.

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

    bdubz4552

    I'm listening to a BlockBurnEvent to fire code for my plugin, but the event simply will not fire. There are plugins on the server I'm testing on such as Essentials that listen to this event, but to counter any cancellation I set IgnoreCancelled to false. Yet, it still isn't firing. Any thoughts?

    And yes, fire spread and destroy are enabled inside Essentials and all other plugins.
     
  2. Offline

    fireblast709

    bdubz4552 Can you post your code? General solutions would be: "Have you registered your listener" and "Do you have the @EventHandler annotation" (though the latter is most likely not the case since you got the ignoreCancelled)
     
  3. Offline

    bdubz4552

    fireblast709
    The handler in my listener class:
    Code:java
    1. @EventHandler(ignoreCancelled = false)
    2. @SuppressWarnings("deprecation")
    3. public void onFernBurn(BlockBurnEvent event) {
    4. Block blockBurned = event.getBlock();
    5. //If not a fern
    6. if (blockBurned.getType() != Material.LONG_GRASS || blockBurned.getData() != 2) {
    7. return;
    8. }
    9. //If a pair does not exist at the event location
    10. if (finder.getPairFromBlock(blockBurned) == null) {
    11. return;
    12. }
    13. action.exit(finder.getPairFromBlock(blockBurned).getPlayer(), ExitReason.FIRE);
    14. }


    onEnable() in main class:
    Code:java
    1. public void onEnable() {
    2. this.log = this.getLogger();
    3. getCommand("fernmode").setExecutor(new FernModeCommand(this, new FernModeAction(this, new Finder(this))));
    4.  
    5. getServer().getPluginManager().registerEvents(new FernModeEventHandler(new FernModeAction(this, new Finder(this)), this, new Finder(this)), this);
    6. }

    The handler in the listener class that watches for player movement works without fail; makes me think something is up within the API.

    fireblast709 Nevermind, found my problem. Thanks for your time anyways!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
Thread Status:
Not open for further replies.

Share This Page