ExplosionPhysics
When a TNT block or other explosive goes off, it will turn all blocks into falling blocks, and then shoot them off with a vector away from the source explosion. All drops are cancelled. Have fun!
All it does, is convert the blocks that n explosion would normally destroy into FallingBlock entities. It then shoots those entities off in different directions. Also it will not run the method if the event is cancelled (in the case of worldguard cancelling explosive block damage)

/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package explosionphysics; import java.util.ArrayList; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.entity.FallingBlock; import org.bukkit.event.Event; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.util.Vector; /** * * @author Taylor */ public class ExplosionPhysics extends JavaPlugin implements Listener{ public ArrayList<Material> disallowedBlocks = new ArrayList<Material>(); @Override public void onEnable(){ getServer().getPluginManager().registerEvents(new ExplosionPhysics(), this); disallowedBlocks.clear(); disallowedBlocks.add(Material.TNT); disallowedBlocks.add(Material.PISTON_BASE); disallowedBlocks.add(Material.PISTON_EXTENSION); disallowedBlocks.add(Material.PISTON_MOVING_PIECE); disallowedBlocks.add(Material.PISTON_STICKY_BASE); } @EventHandler(priority = EventPriority.NORMAL) public void onBlockExplode(org.bukkit.event.entity.EntityExplodeEvent e){ if (e.isCancelled()){return;} if (e.blockList().isEmpty()){return;} e.setYield(0F); double x = 0; double y = 0; double z = 0; Location eLoc = e.getLocation(); World w = eLoc.getWorld(); for (int i = 0; i < e.blockList().size();i++){ Block b = e.blockList().get(i); Location bLoc =b.getLocation(); if (disallowedBlocks.contains(b.getType())){continue;} x = bLoc.getX() - eLoc.getX(); y = bLoc.getY() - eLoc.getY() + .5; z = bLoc.getZ() - eLoc.getZ(); FallingBlock fb = w.spawnFallingBlock(bLoc, b.getType(), (byte)b.getData()); fb.setDropItem(false); fb.setVelocity(new Vector(x,y,z)); } } }
-
View User Profile
-
Send Message
Posted May 26, 2014does not work on 1.7.2+
-
View User Profile
-
Send Message
Posted Mar 11, 2014@Pangamma
Hi, can you please update it for CraftBukkit 1.7.2-R0.3 ? I tried it on my own but I can not make it.
-
View User Profile
-
Send Message
Posted Feb 23, 2014@catprowler
Should be safe to use. WorldGuard should have higher priority.
-
View User Profile
-
Send Message
Posted Feb 21, 2014Hi there, If I have worldguard on my server and I put a region flag to not break certain blocks would this plugin override it? Thank you. :)
-
View User Profile
-
Send Message
Posted Jan 25, 2014@nullschritt
Alright, Alright. I'll add the config option this week.
-
View User Profile
-
Send Message
Posted Jan 15, 2014I actually like it not making the blocks disappear better. It makes explosions messy, like they should be. Not perfectly neat.
-
View User Profile
-
Send Message
Posted Jan 13, 2014@AljedTheLegit
So I take it no chance of a config option to remove blocks after they land?
-
View User Profile
-
Send Message
Posted Jan 12, 2014This plugin would have been useful if it just removed the blocks a bit but this sucks :/.
Thought it would be useful for raiding like they destroy a base and then roll it back so the landscape is not fked.
-
View User Profile
-
Send Message
Posted Oct 10, 2013@jadyha
That's the whole point, lol.
-
View User Profile
-
Send Message
Posted Aug 30, 2013I thought I would love this plugin! And I do! But it's horrible that 10 TNT Will trash a land that are over 100 blocks away. Witch is why I will not keep this plugin installed untill something is done about this. It makes the terrain look HORRIBLE!
-
View User Profile
-
Send Message
Posted Jul 4, 2013@CommodoreAlpha
I agree. I once set a mountain to TNT (ignited it with lots of lag) and after that it looked like it has been raining dirt and stone. xD I guess it should be dropping those blocks or keep them as an entity which disappears after a while, or just vanish them.
-
View User Profile
-
Send Message
Posted Jan 16, 2013This seems to be a really unique plugin that adds a new spin to explosions, which I (and other players) absolutely love. However, I do have a request...
Could you make it so that when the blocks get flown off and land on something, they don't become blocks and simply disappear? This is because, while the flying blocks are fun to watch, the landscape becomes extremely dirty after 100 TNT in a row. You could probably make this a configurable option.
Also, when the blocks that would normally get destroyed convert to entities, does the block still technically get destroyed from the explosion itself, or does the plugin intercept the explosion damage and convert it to an entity with momentum?
This is because the plugin, combined with the above feature and the plugin CreeperHeal, would be awesome to have around (for making TNT more realistic and more visible) without worry of a ruined landscape.
-
View User Profile
-
Send Message
Posted Oct 23, 2012Oh good fun!!
-
View User Profile
-
Send Message
Posted Oct 20, 2012Think it might be cool if the blocks that would usually get destroyed still get destroyed, only the blocks surrounding those become falling blocks and scatter around. It would make TNT more destructive, but that would be a cool option to have =]
-
View User Profile
-
Send Message
Posted Oct 17, 2012@lukecfairchild
nah it doesn't. All it does is take the blocks an explosion is already going to destroy, and turns them into flyingblock entities. Then shoots them off. Since bedrock and obsidian don't pop off they wouldn't be affected.
-
View User Profile
-
Send Message
Posted Oct 16, 2012I saw another plugin like this but it would move obsidian and bedrock. Does this one?
-
View User Profile
-
Send Message
Posted Oct 15, 2012@UltiByte
Thank you! =D
-
View User Profile
-
Send Message
Posted Oct 15, 2012Looks pretty epic! I'll install your plugin for my raid world. ;D
-
View User Profile
-
Send Message
Posted Oct 15, 2012Wow. You seem to have a real knack at making really useful, high quality plugins. :)
-
View User Profile
-
Send Message
Posted Oct 15, 2012Wow. You seem to have a real knack at making really useful, high quality plugins. :)