Hey so I am trying to create a plugin that instantly sets off tnt, the only part I am stuck at is how to detect when TNT is set off by redstone! I have tried RedstoneBlockEvent, but that does not pull up anything! What event should I be using to detect this?
I would think you would get the entity, cast it to TNTPrimed, and then set it from there. Have a look at the Apidocs, tho, that will save you a LOT of these really simple questions...
ExplosionPrimeEvent has no parameter to do so. Right now I'm looking at http://jd.bukkit.org/doxygen/d0/de9...eEvent.html#a73c2cd9764109fe6099e759a2f04a83b I think you might be able to do something with that.
I have been looking at the APIdocs... I am not stupid I could just not find the event that would call up when tnt gets set off... Also an ExplosionPrimeEvent only gets called when the TNT explodes... Is there any other events?
...no, its called when any entity is primed to explode. Get the entity from that event, and set its ticks.
That is called right before the entity explodes, the java doc even says "Called when an entity has made a decision to explode." That is called the tick before it explodes. If your logic was correct then this should have worked. Code: public void ExplosionPrimeEvent(ExplosionPrimeEvent event) { log.info("[iTNT] There was a ExplosionPrimeEvent!"); if (event.getClass() == TNTPrimed.class){ TNTPrimed tnt = (TNTPrimed)event.getEntity(); tnt.setFuseTicks(0); } } That does not work though, is there anyway to detect when redstone current interacts a TNT block?
Nonono, your checking if the event's class is equal to TNT. You want to check if event.getEntity().getClass() == TNTPrimed.class
Thanks for letting me know of that, but the issue is that the ExplosionPrimeEvent is getting called up the tick before the explosion, not after it is primed via redstone.