[REQ] Customisable Anti-Explosion Plugin

Discussion in 'Archived: Plugin Requests' started by zeph, Mar 7, 2011.

  1. Offline


    I know of about 5 plugins which edit the behaviour of explosions, but they are either un-customisable, missing a feature or no longer supported.

    NoExplode Prevents explosion completely (leaving Creeper swelled up). Customisable. No player damage!
    HigherExplosives Configures the explosions themselves, but again no info on if its land or player damage.
    CreeperNerf Repairs terrain damage, not prevents. Does not work on Ghast Fireball. Not customisable.
    FriendlyCreepers Repairs terrain damage, not prevents. Does not work on Ghast Fireball.
    SafeKaboom Repairs terrain damage, not prevents. Works for Ghasts. Not customisable at all.

    You see my problem, and you see i have done some research...

    My idea is to have a mod with the following (very simple) configuration file (and my wanted configuration!):
    Code (Text):
    1. Explosions:
    2.     TNT:
    3.         player-damage: true
    4.         terrain-damage: true
    5.     Creeper:
    6.         player-damage: true
    7.         terrain-damage: false
    8.     GhastFireball:
    9.         player-damage: true
    10.         terrain-damage: false
    This can very simply configure everything most people want.
    Perhaps a global 'yield' value, like from HigherExplosives could be added too.
    Perhaps permissions based so that Admins, etc, can still use TNT to make terrain holes even if terrain-damage is set to false.

    Since most mods tend to repair the damage rather than prevent it, is preventing the damage even possible without stopping the explosion all together? If not, then perhaps stopping the explosion and creating your own events afterwards may be the solution. EG:
    Creeper Hisses, Creeper Swells, Explosion gets cancelled -> start manual events.
    1) Play explode noise.
    2) Remove Creeper Entity.
    3) Damage player depending on distance from Creeper.
  2. I'm so confused...I've had the exact opposite problem. Every plugin I use does exactly what you're asking for. The whole explosion is cancelled and I WANT to see it blow up and then repair.

    It looks really lame when the creeper just disappears -__-
  3. Offline


    What if you could also set the explosion radius?
    like this:

    Code (Text):
    1. Explosions:
    2.     TNT:
    3.         player-damage: true
    4.         terrain-damage: true
    5.         explosion-radius: 10
    6.     Creeper:
    7.         player-damage: true
    8.         terrain-damage: false
    9.         explosion-radius: 5
    10.     GhastFireball:
    11.         player-damage: true
    12.         terrain-damage: false
    13.         explosion-radius: 2
    15. NOTE: i just made the explosion-radius values up.

    Anyway, i support this idea
  4. Offline


    Which mod do you use?

    Personally, i do want the explosion, but i want no terrain damage. I'd prefer the land never to get damaged in the first place, rather than gets repaired. Also being very customisable (IE specifically set TNT, Creeper and Fireball options) is important.

    Adding on Yield...

    Code (Text):
    1. Explosions:
    2.     TNT:
    3.         player-damage: true
    4.         terrain-damage: true
    5.         radius: 10
    6.         yield: 0.3
    7.     Creeper:
    8.         player-damage: true
    9.         terrain-damage: false
    10.         radius: 5
    11.         yield: 1.0
    12.     GhastFireball:
    13.         player-damage: true
    14.         terrain-damage: false
    15.         radius: 2
    16.         yield: 1.0
    So that if you have Creepers allowed to damage land, you get 100% of the blocks back so you CAN repair the land fully.
    Radius could be a multiplier, so a value of '2' would be twice the size of default.
  5. Offline


    I also would request something like this. I am currently searching for a "Ghast Nerf" in essence to allow exploration of the nether without it being destroyed by the 30-40 ghasts above the spawn area.
  6. Offline


    Hi Zeph,

    The HigherExplosives plugin currently only controls the size of the explosions. By which I mean the size influences both terrain damage and player/creature damage.

    I have been holding off coding player/creature damage control into the plugin because there has, until recently (craftbukkit version 557 it seems), been a problem with the damage listeners for Fireballs and TNT.

    When the next recommended build of craftbukkit comes out, I'll be adding in a feature in the next version of HigherExplosives (1.5) to configure the player/creature damage incurred from an explosion.

    However, because the plugin is based on tweaking the radius of the explosion, I don't think it'd quite get what you're looking for. e.g. whilst it would be possible to have explosions that damage terrain without damaging players, it wouldn't be possible to have explosions that damage players without damaging terrain. i.e. There'll always be terrain damage unless the size of the explosion is reduced to zero, in which case there'd never be any player damage either.

    That said, if there are other plugins that repair the terrain after an explosion, perhaps you could combine them with HigherExplosives 1.5 - one to tweak the player/creature damage, and one to repair the terrain. If you're interested in an experimental build of the plugin which also has player damage control, let me know and I'll make a link to it.
  7. Offline


    Actually, it's turning out fairly straightforward to prevent terrain damage (looks like a repair on the client) and fairly easy to control player/creature damage. I'll drop another message here when HigherExplosives 1.5 is finished and give an example config, probably within the next two days.
  8. Offline


    With HigherExplosives 1.5 (source is here, jar is here), the configuration for this would be:

    Code (Text):
    2. entities:
    3.     TNTPrimed:
    4.         playerDamageMultiplier: 1.0
    5.         preventTerrainDamage: false
    6.         radiusMultiplier: 10
    7.         yield: 0.3
    8.     Creeper:
    9.         playerDamageMultiplier: 1.0
    10.         preventTerrainDamage: true
    11.         radiusMultiplier: 5
    12.         yield: 1.0
    13.     Fireball:
    14.         playerDamageMultiplier: 1.0
    15.         preventTerrainDamage: true
    16.         radiusMultiplier: 2
    17.         yield: 1.0
    18. version: '1.5'
    Those radiusMultiplers are very large mind.

    It's possible to configure terrain damage without player damage. It's also possible to configure player damage without terrain damage.
  9. Offline


    This is fantastic! This mod now has everything one can ever want regarding explosions for all three entities.

    I hope the bukkit community reflects my satisfaction with your now all inclusive mod!
  10. Offline


    I have one more added request.

    In the old CreeperNerf plugin from hMod there was a setting to specify the "z" coordinates under which the plugin would activate.

    Is there any chance of adding a feature that let's creepers do damage everywhere, but only do terrain damage below a certain level?
  11. Offline


    Thanks zeph :)

    To a certain extent version 1.5 of HigherExplosives already allows this. A config that should do this is:

    Code (Text):
    2. entities:
    3.     Creeper:
    4.         preventTerrainDamage: true
    5.         activeBounds:
    6.             max:
    7.                 y: -16
    This config would make creeper explosion act as normal, unless the epicentre of the explosion is lower than -16.

    There's some rough documentation here on the activeBounds configuration. Look under the "Optional bounds configuration" heading.

    Currently there is a limitation with this. For the same entity type, it's not possible to have an active configuration in one area (e.g. double sized explosions) and another active configuration in another area (e.g. double player damage). Hope that makes sense..
  12. Offline


    Hey guys!

    Really cool and interesting ideas at all!
    I think I'll try to implement the most of your ideas in my plugin "AntiExplosions". I think you guys made a really good job founding the features! When I do, I will of course link to this great thread!
    I hope you'll get what you explained :)

Share This Page