GuilleX7 / ExplodeAny

Bukkit plugin that allows to control any explosion
GNU General Public License v3.0
0 stars 0 forks source link

Add support for custom explosive blocks (as entities) #20

Open GuilleX7 opened 8 months ago

GuilleX7 commented 8 months ago

Using servers like Mohist, ExplodeAny can be combined with Forge mods like https://www.curseforge.com/minecraft/mc-mods/homyatos-explosives, which add explosive blocks. Since these blocks operate using the Vanilla Minecraft API, they emit a BlockExplodeEvent when they explode. However, the originating block seems to be air, as happens with exploding Vanilla blocks.

While there exist some workarounds for tracking Vanilla blocks (such as listening to PlayerEnterBedEvent or PlayerInteractEvent and knowing the logic behind explosions), there's no way to know when these blocks will explode. It seems the only way is to track them after they've been placed (through BlockPlacedEvent and BlockBreakEvent), and then checking their positions when a BlockExplodeEvent has occurred.