Hanging broken by TNT without a source triggers HangingBreakEvent instead of HangingBreakByEntityEvent

XMLWordPrintable

    • Type: New Feature
    • Resolution: Unresolved
    • Priority: Minor
    • None
    • Affects Version/s: None
    • Environment:

      Latest Spigot build

      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.

            Assignee:
            Unassigned
            Reporter:
            StarTux
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: