[Solved/Possible Bug]EntityExplodeEvent.blockList is empty with TNT spawned using world.spawnEntity?

Discussion in 'Programming' started by Trophonix, May 25, 2016.

  1. Hey, so I think I found a bug, or maybe I'm just being stupid and someone could steer me in the right direction. :)

    I am using world.spawnEntity() to spawn primed tnt with custom names so I can do things with them when they explode in the EntityExplodeEvent. If I loop through event.blockList() and print the locations, with a normal TNT it works just as expected. However, with a spawned in TNT it doesn't print anything. There's no way to get any direct information about the explosion through EntityExplodeEvent so I don't really know how I could make my own list of blocks. Any ideas?

    UPDATE: The problem was that there are two EntityExplodeEvents called when it blows up and only the second one has the blockList filled in.
     
    #1 Trophonix, May 25, 2016
    Last edited: May 25, 2016
  2. Can we see some of your code?
     
  3. I 'kind of' found the problem. This is a problem with all explosives though. There seems to be 2 EntityExplodeEvents going off for every explosion. Since I was tracking the tnt with a map and removing once an explosion has been detected from one of my custom entities, I was only catching the first event, which has an empty blockList.
     
    • Like Like x 1