[SPIGOT-519] TNT Ignite Event Created: 03/Feb/15 Updated: 03/May/23 Resolved: 03/May/23 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor |
| Reporter: | Nicolas Glassey | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 16 |
| Labels: | event, tnt | ||
| Environment: |
All |
||
| Issue Links: |
|
||||||||
| Description |
|
Currently, there is no event firing when a TNT block is lit, no matter the cause. We have to listen for Player Interacts (right click with Flint+Steel), Block Physics (redstone-related) and Entity Change Block (arrow hitting block, ...) events, to cover This has been asked countless times on Bukkit since three years now, and has never been done. |
| Comments |
| Comment by AMinecraftDev [ 24/Nov/16 ] |
|
I would also love this, because it would help with managing tnt for custom tnt purposes. |
| Comment by pokechu22 [ 19/Aug/16 ] |
| Comment by Black Hole [ 31/Jul/16 ] |
|
While CraftBukkit was handled by the Bukkit team it was suggested to call EntityChangedBlockEvent with the TNTPrimed entity as the source. The entity could carry a reason and/or source, since plugins might need that information later when the actual explosion happens. |
| Comment by pokechu22 [ 31/Jul/16 ] |
|
Oh yea, I almost forgot - the TNT block is set to air both clientside and serverside in some cases. So for the event to be useful, the block would need to be resent if the event is canceled. |
| Comment by pokechu22 [ 31/Jul/16 ] |
|
Working on a patch for this. I think it makes more sense to create a separate event than to use BlockIgniteEvent since BlockIgniteEvent is always used when a fire block is created from ignition (and only with fire). There are several additional causes, though, which makes it more complex. The mostly obvious ones:
But then there are the more subtle, annoying causes:
It's these situations that make it pretty hard to implement this event, and without handling them, the event is a lot less useful (since primed TNT could still be created in ways that wouldn't be expected). |
| Comment by Rexcantor64 [ 28/Jul/16 ] |
|
+1 |
| Comment by Camden b [ 15/Apr/16 ] |
|
+1 |
| Comment by Riaz :D [ 10/Feb/15 ] |
|
+1 |
| Comment by Janmm14 [ 03/Feb/15 ] |
|
added |
| Comment by Nicolas Glassey [ 03/Feb/15 ] |
|
I would be fine with the BlockIgniteEvent too. Also for the causes, maybe adding REDSTONE to them too... |
| Comment by Janmm14 [ 03/Feb/15 ] |
|
You are right, the BlockIgniteEvent is not called when you activate a tnt block. I think there does not need to be a TntIgniteEvent, its just needed that the BlockIgniteEvent is called if TNT is ignited. Wherefore the ignite causes should be shrinked to FLINT_AND_STEEL, ENTITY, SPREAD, REDSTONE |
| Comment by Nicolas Glassey [ 03/Feb/15 ] |
|
Yes, and that event is fired when the TNT has exploded and ignites surrounding blocks. |
| Comment by Janmm14 [ 03/Feb/15 ] |
|
Did you tried listening to the BlockIgniteEvent? |