Getting when TNT is ignited

Discussion in 'Plugin Development' started by techboy291, Feb 18, 2013.

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

    techboy291

    Hi,

    So I'm trying to get when TNT is ignited in my plugin. I need to do this because I'm trying to make a plugin that explodes TNT instantly when a redstone signal is applied to it. I want to either cancel the event and use the createExplosion() method in the World class, or set the ticks before the TNT explosion to 0. From my understanding, I can't use ExplosionPrimeEvent because that's activated the tick before the explosion. Versus I don't want there to be a blinking effect with the TNT. I just want to make it explode (or create an explosion where it's at) immediately upon being ignited. Any ideas? Thanks in advance! :)
     
  2. Offline

    chasechocolate

    I don't know if this will work, but you could listen for CreatureSpawnEvent, and check if the event.getEntity() is TNTPrimed (just another crazy idea :p).
     
  3. Offline

    techboy291

    Huh, that's actually not a bad idea. I'll check that out, thanks.
     
  4. Offline

    mastermustard

    i was thinking about this for an idea and it should work...

    >check if a redstone torch was placed
    >check if tnt is in the 1 block radius around the torch
    >create a explosion (this would be a seperate explosion caused through your plugin see below)

    the reason im certain this would work is because all that (should) happen before the tnt gets primed because of the 1 tick difference. and since unprimed tnt instantly explodes thers no reason that this shouldn't work
     
  5. Offline

    techboy291

    Thanks!
     
Thread Status:
Not open for further replies.

Share This Page