[INACTIVE][FUN] HigherExplosives v2.0 - Configurable multiworld explosion control [860]

Discussion in 'Inactive/Unsupported Plugins' started by toadmess, Feb 26, 2011.

  1. Offline


    HigherExplosives - multi world control of explosions (size, player/creature/terrain/item damage, % items dropped, and TNT fuse duration and permissions support):

    Version: v2.0

    With some simple tweaking to the automatically created config.yml file, you can individually change the TNT, creeper, or fireball explosions for all worlds, or tailor specific worlds.
    The configuration is fairly flexible, so with some more determined configuration there are a myriad different worlds with exotic explosion qualities that can be crafted. :)

    It was compiled and tested against CraftBukkit version 860 (recommended build).

    • Control the size of explosions for TNT, creepers and ghast fireballs.
    • Control the percentage of dropped items (called yield) from the destroyed blocks, from no items dropped through to one item dropped per destroyed block.
    • The yield of every different block type can be individually configured if so desired.
    • Optional prevention of terrain damage
    • Multiple world configurations
    • Allows configuration of different blast radii, with different probabilities for each being chosen
    • Allows configuration of different player damage (optionally with different probabilities for each being chosen)
    • Allows configuration of different creature damage (optionally with different probabilities for each being chosen)
    • Item damage can be configured (optionally with different probabilities for each being chosen)
    • Fuse length of TNT can be tweaked.
    • Some simple control over which areas the modified explosions will happen in
    • TNT triggered by redstone, fire, explosion, or by a player's hand can be configured separately
    • The triggering of TNT can be prevented (either generally, or specifically for fire, explosion, hand, or redstone)
    • Permissions support for TNT triggered by hand. Any number of different configurations for players with certain permissions and/or groups can be applied.
    • Charged creeper's explosions can be configured

    The v2.0 HigherExplosives.jar is at https://github.com/downloads/toadmess/HigherExplosives/HigherExplosives.jar

    In case there are problems with v2.0, the older v1.7 HigherExplosives.jar is still available from https://github.com/downloads/toadmess/HigherExplosives/HigherExplosives1.7.jar

    The source code (changes are most welcome) is at https://github.com/toadmess/HigherExplosives/


    Straight out the box this will double the size of TNT explosions. No configuration required, just drop the HigherExplosives.jar in the plugins directory.

    Known issues:
    Show Spoiler

    • If you set the yield too high, the server will lag a lot whilst trying to rotate all of the items left in the crater.
    • If the radiusMultiplier is much less than 1, I think the client is rendering the explosions as normal, but then corrects itself a moment afterwards when it hears about what really happened from the server. This has a kind of double-take effect.
    • If the radiusMultiplier is set too high, the shape of the terrain damage takes on a kind of streaking or criss-crossing effect. I think this is to do with the way minecraft creates the explosions (http://www.minecraftwiki.net/wiki/Explosion).

    Example Configuration:

    For full configuration details check out the README file at https://github.com/toadmess/HigherExplosives/tree/v2.0

    Meanwhile, here's a contrived example configuration that covers most of the simpler features, together with an explanation below it:
    Show Spoiler

            yield: 0.15
            radiusMultiplier: 2.0
            preventTerrainDamage: true
                    x: 500
                    z: 500
                    x: -500
                    z: -500
                    playerDamageMultiplier: 2.0
                    itemDamageMultiplier: 0.0
                    fire: false
                    creatureDamageMultiplier: 2.0
                        - {chance: 0.25, value: 0.3}
                        - {chance: 0.25, value: 1.5}
                        - {chance: 0.5, value: 1.0}
                        - {chance: 0.5, value: 0.0}
                        - {chance: 0.5, value: 1.0}
                    yield: 0.0
                        2: 0.8  # Grass
                        3: 0.8  # Dirt
                        12: 0.8 # Sand
    version: '2.0'
    debugConfig: true
    In this example config, the size of TNT explosions are doubled and the number of items they drop is set at 15%. This would by applied by default in all worlds except the world named "world_nether" and the world named "wildwest".

    In the world named "world_nether", TNT explosions will have a normal blast radius and yield, but nearby items will be impervious to them. Whilst they don't damage items, TNT explosions in the nether will be twice as damaging to players when exploding, but creatures will take damage as normal.

    By default, creepers will not damage terrain in a 1000x1000 square area around 0,0. They will however still damage creatures and players as normal. Outside of the safety area, the terrain will be damaged as normal by Creepers. This applies to all worlds with this example configuration because no other world has a specific configuration for the Creeper entity.

    Ghast fireballs in the "world_nether" world will not cause fire but will be twice as damaging to other creatures. They'll damage players as normal fireballs do. Fireball explosions in any other world will be left unmodified.

    In the wildwest world, TNT is flakey and unreliable. 50% of the time TNT will explode immediately without any fuse. The sizes of the TNT explosions will also vary, with half of them being normal, a quarter being very small, and a quarter being fairly large.

    Creeper explosions in the wildwest will cause destroyed grass, dirt and sand blocks to drop items 80% of the time. All other destroyed blocks will drop nothing.

    To check if the plugin is reading the configuration correctly, you can add a "debugConfig: true" property. It defaults to false if it's not in the config file.

    Show Spoiler

    Version 2.0
    • Nested configurations allow completely different behaviour for TNT depending on whether it was activated by fire, player, redstone, or some other explosion.
    • Permissions plugin support. Allows any number of configurations to be applied when a player's hand triggers a TNT block, so long as the player has the necessary permission and/or belongs to the necessary group.
    • Charged creepers can now be specifically configured with the "creeperCharged" nested configuration.
    Version 1.7
    • The yield of specific block types can now be individually configured via the "yieldSpecific" property.
    • Renamed the "trialTNTFuseMultiplier" config property to "tntFuseMultiplier"
    • Massive internal restructuring of the code. Should be more lean and mean.
    Version 1.6

    • (Experimental) TNT fuse durations can be configured via the "trialTNTFuseMultipler" property.
    • Item damage can be configured via the "itemDamageMultiplier" property
    Version 1.5.1

    • Now detects the MiningTNT plugin and works with it (specifically the yield values)
    • Checks for cancelled events, so it plays a little nicer with other plugins that cancel an event.

    Any dontations are not necessary, but are certainly appreciated! All the money goes to charity (currently going to Doctors Without Borders) except for the very occasional beer which will go to me :)
  2. Offline


    Hey folks. :)

    I had an idea the other day (I'm sure others have too) about a nuclear explosion, or something grand scale like that.

    Is it possible to set an item with a bomb/explosion radius that is huge and could wipe out a large portion of the map? Also, does the power of the explosion determine how far down blocks are torn apart? Ex: A small explosion might dig down 1 or 2 blocks, while a large one might leave a massive crater?

    The other idea I'd love to see would be a large object or image traveling towards the ground from the heavens. Something bright like a large fireball. You could say it is a meteorite, a weapon from the Gods, etc... Anyhow, something that would light up the sky at night and alert all the players who would look up thinking WTF is that? Then realize "Holy Shite!!!!! A few moments later the object hits the ground and BOOOOOOOOOM massive or rather large explosion damaging houses, blowing out mountainsides, etc....

    Well, thats my idea. Sorry for rambling on about it, but just visioning it as I was writing it gave me the creeps.

  3. Offline


    Result of a 100x TNT 2011-03-17_17.54.01.png
  4. Offline


    Is it possible to recompile this for the latest recommended build of CraftBukkit?

    And also is there a way to add another config line for each that is damage radius? Like say I was a creepers damage radius to be normal, but the block destroy radius to be half.
  5. Does this work with the newer versions of Craftbukkit?
  6. Offline



    Yes, it should still work fine in the latest recommended craftbukkit. I gave 556 a quick try and it seems to work fine so I'll update the title.


    Thanks! It has been really satisfying to code, especially because of comments like yours :)

    Wow, nice! :)

    I tried a 30X TNTplosion and also got that streaking and criss-crossing effect. I think it's because of the way the explosions are coded in minecraft (http://www.minecraftwiki.net/wiki/Explosion).

    Nice idea. :)
    It should be fairly easy to code up (assuming the durability API is straightforward). Feel free to grab any code from the github repository.

    If I get some time, I might create a quick experiment plugin to try it out, if that's ok with you?

    It'd also be nice to be able to combine several TNT into a greener TNT using the crafting box, but as I understand it, we don't have a great deal of control over crafting.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 10, 2016
  7. Offline


    I can't remember off the top of my head, but there was some kinda torch plugin that used the durability for torches as light sources that might make a good reference. If I recall it was using the durability as a timer loop. I'll see if I can hunt that up for ya.
  8. this plugin is broken with b602jnks:
    2011-03-30 14:04:06 [SEVERE] EXPLOSION_PRIMED loading HigherExplosives v1.4 (Is it up to date?)
    java.lang.NoSuchFieldError: EXPLOSION_PRIMED
        at toadmess.explosives.HEMain.regExplodingListener(HEMain.java:60)
        at toadmess.explosives.HEMain.onEnable(HEMain.java:43)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:511)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:216)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:93)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:71)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
  9. Offline


    Thanks for letting me know and for the stacktrace. I'll have a look to it tonight.

    There's an experimental build here that can be used as a temporary fix for anyone using craftbukkit 602. It's had a fair few internal changes as it's really halfway to version 1.5 (support for player/creature damage multipliers) but should hopefully still work fine.

    I'll get to a proper fix with version 1.5 in the next few days.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 10, 2016
  10. Offline

    Adam McFarland

    Cool, wasn't sure if this was going to be supported. Your experimental build works fine in 602, thanks.
  11. will try experimental version: Thanks for Your support !
  12. Offline


    dumb explosion shapes, 602 has a new api, so people using that will find most plugins wont work :p
  13. Offline


    New version now works with the latest recommended build 617 and has support for:
    • Preventing terrain damage
    • Changing the amount of damage a player takes (can be randomly chosen from a list)
    • Changing the amount of damage a creature takes (can be randomly chosen from a list)
  14. Offline


    best explosion plugin out there for sure.
  15. Offline


    The latest changes makes this the top anti-explosion mod there is! Thank you @toadmess!

    How about permission override? EG if TNT "preventTerrainDamage: true" for everyone, but admins can override this and still use it to blow 'stuff' up? Just a thought.
  16. Offline


    Ok.. so I'm pretty new to Minecraft, but realy love this "little" game. I love this plugin and it works well and everything though I have one small problem. I use this plugin and MiningTNT. I'm running the latest build (617) and it seems that this plugin and MiningTNT are conflicting in some way. It's not that I get errors or anything the problem is that when I have both plugins running the drop % feature in this plugin seems to be disabled somehow. Or atleast it has no effect. As soon as I disable MinningTNT it works just fine.

    So my question is: could you implement the feature from MiningTNT with the "only destroy specific blocks" since this is the only reason I'm aslo using MiningTNT. Or could you try and look into the conflict these 2 plugins have.

    I know this problem maybe only lays with me, but I would appreciate if you could help me out here.

    Thanks in advance
  17. Offline


    derfernet, zeph: Many thanks for your comments. They're very kind :)

    Sounds like it should be possible in some form or another. I'll try to look into it this weekend.

    So far, I have been reticent about letting any feature have a requirement for Permissions to be installed. Do you need Permissions based support specifically, or would a config like the one below work?

            preventTerrainDamage: true
            radiusMultiplier: 0.0
                preventTerrainDamage: false
                radiusMultiplier: 2.0
                playerDamageMultiplier: 2.0
                creatureDamageMultiplier: 2.0
    The thinking behind this is that if the TNT is triggered by a player right clicking on it, and that player is an admin, then a different configuration is used instead. In the example config any normal player, or redstone, or explosion that triggers the TNT would just have no explosive effect, but if an admin triggered it by hand then the explosion would be twice as nasty.

    I have been thinking about using this kind of configuration override for redstone triggered TNT, explosion triggered TNT, and normal player triggered TNT. So any of these different triggers could then have any of the normal entity configuration properties set for them. e.g. it'd be possible to configure TNT that could only be detonated by redstone.

    Hi Szandor,

    Good to hear your enjoying the game and having fun with this plugin too :)

    It was probably only a matter of time until a conflict would be found between this plugin and another. However, it sounds like the two plugins might nicely be complementary if the conflict can be resolved. I'd much rather fix the conflict than emulating or treading on the good work made by @Taco with MiningTNT.

    I'll look into the MiningTNT plugin at the weekend and play around with them both installed.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 10, 2016
  18. Offline


    Cool, Make Tnt Only damage 1 block?
  19. Offline


    Cheers for the respons toadmess.. And I hope you are able to re-create the conflict and find a solution.
  20. Offline


    If there is a problem, maybe we can get together on irc or something and try to work out something to fix the conflict?
  21. Offline


    Could I request a customisable delay to TNT?
    Those big explosions are not overly conducive to living.
    But they are such a joy to use.. do you think I have a problem?
  22. Offline


    For the conflict, maybe you can try something like this in your main class:

    private void checkForConflict()
    Plugin conflict = this.getServer().getPluginManager().getPlugin("MiningTNT");
             public boolean conflict = true; //This will be checked later
             public static List<String> MiningTNTBlocks = plugin.destroy; //destroy is what my list of blocks that can be destroyed is named.

    Then where you handle your explosions:

        else if(HigherExplosives.destroy.contains(Integer.toString(block.getTypeId()))
             //Do something here to get the block and position and then determine the item dropped.
             block.getWorld().dropItemNaturally(pos, item);
        //Do what you normally do.
    Hope that helped some!
  23. Offline


    Is there a way that you can increase the damage done by a TNT explosion so that, as an example, even obsidian could occasionally be destroyed by a blast?
  24. Offline


    Hey Taco, many thanks for your help! :)
    I'm quite hopeful things can be sorted out, I've sent you a fairly long message about it.

    Yes, this is something I really want to get in as a feature after admin config support. I think the cleanest way, avoiding strange problems, would be to change the fuse length on the primed TNT (or Creeper). There's currently no support in Bukkit for changing the fuse length of TNT or Creepers, so it'd require changing the minecraft server's internals directly. Because of that, it would be very experimental and would only work against one client version. So there would be a delay when minecraft gets updated before I get round to re-enabling it.

    It would also be nice to have TNT with very short fuses so they explode in rapid succession.

    Heheh, maybe, but then you're not alone with that particular problem around here :)

    I think the terrain damage is determined by the blast radius. You'd probably need a very big blast radius though. There's an excellent article here on explosion radius and block resistance. I've not tried to digest the maths involved, but it's clear you'll need an enourmous blast radius. Good luck.

    There may be an easy way to change the level of damage caused to blocks. I'll keep an eye out for it.

    Taco and I have both now updated the plugins to make them work together.
    Just grab the latest .jar for both plugins and it should be fine.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 10, 2016
  25. Offline


    Ive been testing the mod and the config we made up, and it's working fantasticly.

    Minor bug though, with "preventTerrainDamage: true", explosions cause no sound. Probably a complex fix, since i don't think the server can issue sounds to play?
  26. Offline


    Thx a ton... both of you.. you made me a happy minecraftian :D
  27. Offline


    That's strange. I just tried this with craftbukkit 670 with just this plugin installed. Detonating TNT with the preventTerrainDamage set to true still plays the explosion sound for me.

    Is it TNT that's silent for you, or some other entity? Do you have any other plugins installed?

    Edit: Actually, yes I'm seing the occasional explosion with no sound. I'm running the server on the same machine - perhaps the speed of the network affects it? I'll try and track it down.
    You're right, Bukkit doesn't seem to support making sounds, but it is possible to go directly and poke minecraft in just the right spot to produce sounds (though this method may need fixing whenever a new minecraft version is released).

    Version 1.5.2. This fixes the explosion sounds when terrain damage is being prevented (when the config.yml contains "preventTerrainDamage: true")

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 10, 2016
  28. Offline


    This mod, combined with EggGrenades, is the most fun I've had in a long time
  29. ii like this mod however would love a way to have to settings which would be enabled through command in game.I want to be able to make a miner tnt and a nuke so for example /nukeon /nukeoff and /minetnton /minetntoff....i dont know how hard that would be but i hope it can be done.

    Thank you
  30. Offline


    It was the Creepers who were silent., but recently they've been fine. (EDIT - because you patched it ! :D )

    How about adding the option to prevent TNT chaining? IE one TNT explosion triggers the next? Would help with the anti-griefing side of things, limiting TNT to be used one at a time.
  31. Offline


    Great, glad that's working now. The fix is a little exotic, so there's a chance it will fail when the next version of minecraft comes out. Any fail should hopefully be graceful though.

    Inspired by your request for admin only TNT configurations, I'm hoping to version 1.7 the possibility for having different configurations for the different ways in which TNT can be primed. This would let TNT explosions act differently depending on whether they were primed by explosion, fire, player hand, admin hand, or redstone.

    I think it would be possible to use this same configuration mechanism to prevent TNT chaining - i.e. you could have a special configuration for TNT blocks primed by explosions, which just nullifies the explosion.

    I'm not too sure, but it's possible the "preventTerrainDamage: true" config might already prevent another TNT block from being primed by an explosion. I think it's considered to be part of the terrain.

    Heheh, this made me smile, thanks :)

    I've been holding off making commands for a while because it's difficult to see how they could easily be used with complicated configurations. However, your example of toggling different configs on or off seems nice to use.

    Perhaps a compromise could be to switch between different config.yml files with a command in game. e.g. something like "/heconfig nuke" would change from the default config.yml file to nuke.yml. Would that work for you?

    New version 1.7 works with the latest recommended build 677 and has support for:
    • Changing the TNT fuse duration via the "trialTNTFuseMultiplier" property. This is EXPERIMENTAL, so please let me know if anything's awry with it. When it's shown to be stable, I'll rename the configuration name to just "tntFuseMultiplier".
    • The "itemDamageMultiplier" property. Applies to any non-living entities caught in the blast (including items on the ground, paintings and other things like that). Set it to 0.0 to stop items from being destroyed in blasts.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 10, 2016

Share This Page