Solved Can someone explain BlockBurnEvent to me?

Discussion in 'Plugin Development' started by blackwolf12333, May 28, 2014.

Thread Status:
Not open for further replies.
  1. According to the documentation BlockBurnEvent is fired when a block is burned:
    The problem however is that it is not fired when the blocks I ignite with flint and steel disappear(leaves). Is this a bug or is the documentation wrong?
     
  2. blackwolf12333
    Works for me.
    Try this:
    Code:java
    1. @EventHandler
    2. public void onBurn(BlockBurnEvent event){
    3. String blockburnt = event.getBlock().getType().toString();
    4. Bukkit.broadcastMessage(blockburnt+" has burned!");
    5. }


    And make sure you register the event on your onEnable() method.
     
  3. Does it make a difference if I have @EventHandler(priority = EventPriority.HIGHEST) ?
    Because that's pretty much the only difference :/

    Edit: that is indeed the problem, but do you know why?
     
  4. blackwolf12333
    Unless you have other plugins with MONITOR overriding your BlockBurnEvent it shouldn't make any difference whatsoever. Like I said, I tested that and burnt a tree down, it broadcasted this:
    Show Spoiler

    [​IMG]
     
  5. Offline

    desht

    The documentation is right - what you actually want is the BlockIgniteEvent, which is fired when a block is first set on fire.

    BlockBurnEvent is for when a block burns away completely (e.g. a wood block which has been burning for several seconds turns to an air block).

    Never mind - I misread your original post. I see you are indeed talking about blocks burning away completely.
     
  6. desht
    He already marked it as solved, why post?
     
Thread Status:
Not open for further replies.

Share This Page