Cancel TNT ignite by fire arrow

Discussion in 'Plugin Development' started by Welite, Nov 24, 2014.

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

    Welite

    Is there any event that is called while the TNT Block is changed to PRIMED_TNT entity ? I need to cancel igniting the TNT by fire arrows is there any way ?
     
  2. Offline

    adam753

    You can use BlockIgniteEvent and check its IgniteCause, although I'm not sure what cause it would give for a fire arrow.

    Sorry, that wouldn't work - you need ExplosionPrimeEvent, which doesn't seem to offer a cause. Hmm.
     
  3. Offline

    Welite

    So there is really no way how to cancel prime caused by an fire arrow ?
     
  4. you can check if theres any nearby fire arrow in a radius of 0.5 or something (in ExplosionPrimeEvent)
     
  5. Offline

    Welite

    But it is too late, I need to stop the action when the TNT is changed to entity (PRIMED_TNT).
     
  6. Offline

    Jaaakee224

    Welite
    Might not work but.. check for projectile hit event, if instance is an arrow, get block, if block is tnt, cancel?
     
  7. Offline

    RawCode

    This handled by arrow, tnt is simple block and completely passive, please check EntityArrow source code for more info.

    if there is no event - class override by any means or custom build
    if there is event - you will get it's name

    in both cases you must "waste" some time for research and you must do it self.
     
  8. Offline

    pookeythekid

    If the event can be cancelled, it's not too late. The action does not take place until the server has confirmed that no plugins are cancelling it.
     
Thread Status:
Not open for further replies.

Share This Page