When a painting or item frame is broken by TNT that does not have its source set, Spigot calls HangingBreakEvent rather than HangingBreakByEntityEvent. Identifying which TNT broke a painting is impossible.
Reproduce:
- Listen for HangingBreakEvent and HangingBreakByEntityEvent
- Place painting or item frame
- /summon tnt
- Watch HangingBreakEvent being called instead of HangingBreakByEntityEvent
Any one of the following suggestions would solve the problem for me:
- Call HangingBreakByEntityEvent with the TNTPrimed set as remover when TNTPrimed.source is null.
- Add TNTPrimed.setSource(Entity)
- Fire EntityDamageByEntityEvent in addition to HangingBreakEvent. This would solve a broader issue where hangings are treated special when damaged, potentially breaking older code and causing a common oversight when protecting entities.
Thank you for your time.