Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-3222

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

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • 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.

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

              Created:
              Updated: