Getting when TNT is ignited

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

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



    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


    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


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


    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


Thread Status:
Not open for further replies.

Share This Page