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

getBlock() Returns air for BlockExplodeEvent

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • None
    • 1.20.4-R0.1-SNAPSHOT
    • Yes

      im trying to get the block that caused the BlockExplodeEvent with getBlock() 

      @EventHandler
      public void onBlockExplosion(BlockExplodeEvent event)  {
          Block block = event.getBlock();
          getLogger().info("Block Explosion Detected! "+block);
          if (plugin.cancelRespawnAnchorExplosionGrief) {
              getLogger().info("1 ");
              event.blockList().clear();
          }
      
      }

      however it returns 

      CraftBlock{pos=BlockPosition{x=-28, y=91, z=28},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@5630d714} 

      I was told in the discord that this was a bug and to make a ticket or whatever.

            2008Choco Parker Hawke
            Subaka Silly lil Goober
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: