Exploding Enderchest

Discussion in 'Spigot Plugin Development' started by GB_6, Apr 29, 2017.

  1. I want it so when tnt explodes that normally would have exploded an enderchest i would be able to set that enderchest to air and drop a custom item. I dont know how i would go about doing this. Thanks for any suggestions.
     
  2. It returns a list of all blocks that were affected by the explosion...

    There's also TNTPrimedEvent (or something similar)
     
  3. blockList
    public List<Block> blockList()
    Returns the list of blocks that would have been removed or were removed from the explosion event.
    Returns:
    All blown-up blocks
     
  4. Read it again.

    Returns the list of blocks that would have been removed or were removed from the explosion event.
     
    • Agree Agree x 1
  5. Look man I dont care what the javadocs say, If i place a tnt on top of enderchest and explode it and print out every block in event.getblocklist() it does not contain an enderchest.
     
  6. This is because the enderchest has a damage value that a normal tnt cant destroy.

    To get the ender chest,you might have to run some calculations such as,
    Loc#clone().add (0,1,0)
    Loc#clone().add (1,0,1)
    Loc#clone().add (-1,0,1)
    Loc#clone().add (1,0,-1)
    ...ect to the radius you want to check to. Just
    I dont see another way exactly but if the above doesnt work. Ill give you some other method.
     
  7. I'll give that a shot I guess. But wouldn't that be very intensive on a factions server with 1000+ tnt exploding in a few ticks?
     
  8. I suggest running it asyncronously. Defenitely dont run it in sync xD. It should work alright.
    Ill think of any other way and if I find any, ill post here.
     
    • Friendly Friendly x 1
  9. Thanks you man!