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

BlockExplodeEvent for beds triggered too late

XMLWordPrintable

      If one explodes a bed in the Nether or End, I would've expected the sequence of events to go:

      BlockExplodeEvent (getBlock().getType() == Material.BED_BLOCK or Material.BED, cancellable)
      EntityDamageEvent (getCause() == DamageCause.BLOCK_EXPLOSION)
      PlayerDeathEvent (assuming the player died from the damage)

      However, the events seem to instead go:

      EntityDamageEvent (getCause() == DamageCause.BLOCK_EXPLOSION)
      PlayerDeathEvent (assuming the player died from the damage)
      BlockExplodeEvent (getBlock().getType() == Material.AIR, cancellable but no effect)

      This makes it impossible to track damage or deaths caused by bed explosions. 

      Steps to reproduce:

      1. Create a plugin that listens for EntityDamageEvent and BlockExplodeEvent events.
      2. Make the plugin print the damage cause under EntityDamageEvent (getCause()) and the block type under BlockExplodeEvent (getBlock().getType())
      3. Enter the Nether or the End, go into survival/adventure mode, place a bed down and try to use it.
      4. Observe the cause as BLOCK_EXPLOSION and the block type as AIR.

            Unassigned Unassigned
            CosmoConsole CosmoConsole
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: