[REQ] Customisable Anti-Explosion Plugin

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

  1. Offline

    zeph

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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:
    Explosions:
        TNT:
            player-damage: true
            terrain-damage: true
        Creeper:
            player-damage: true
            terrain-damage: false
        GhastFireball:
            player-damage: true
            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. Offline

    SeeD419

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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

    Miauw62

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    What if you could also set the explosion radius?
    like this:

    Code:
    Explosions:
        TNT:
            player-damage: true
            terrain-damage: true
            explosion-radius: 10
        Creeper:
            player-damage: true
            terrain-damage: false
            explosion-radius: 5
        GhastFireball:
            player-damage: true
            terrain-damage: false
            explosion-radius: 2
     
    NOTE: i just made the explosion-radius values up.


    Anyway, i support this idea
  4. Offline

    zeph

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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:
    Explosions:
        TNT:
            player-damage: true
            terrain-damage: true
            radius: 10
            yield: 0.3
        Creeper:
            player-damage: true
            terrain-damage: false
            radius: 5
            yield: 1.0
        GhastFireball:
            player-damage: true
            terrain-damage: false
            radius: 2
            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

    Zonkcraft

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    With HigherExplosives 1.5 (source is here, jar is here), the configuration for this would be:

    Code:
    entities:
        TNTPrimed:
            playerDamageMultiplier: 1.0
            preventTerrainDamage: false
            radiusMultiplier: 10
            yield: 0.3
        Creeper:
            playerDamageMultiplier: 1.0
            preventTerrainDamage: true
            radiusMultiplier: 5
            yield: 1.0
        Fireball:
            playerDamageMultiplier: 1.0
            preventTerrainDamage: true
            radiusMultiplier: 2
            yield: 1.0
    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

    zeph

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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

    saturnine

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Thanks zeph :)

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

    Code:
    entities:
        Creeper:
            preventTerrainDamage: true
            activeBounds:
                max:
                    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

    cinematikk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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 :)

    This post has been edited 1 time. It was last edited by TnT Nov 1, 2013.

Share This Page