Inactive [MECH/ADMN] ModDamage - Change damage mechanics on the fly!

Discussion in 'Inactive/Unsupported Plugins' started by KoryuObihiro, May 20, 2011.

  1. Offline

    KoryuObihiro

    ModDamage
    We've moved to BukkitDev!
     
  2. Offline

    Phat32

    isonfire worked perfectly! lol thanks for the help! we seem to be perfectly out of sync haha.

    Follow up question. Is there a way to detect when the target is hurt by an arrow and who fired it? Trying to make classes and some of them we want arrows to do certain things, fishing hooks doing others etc.
     
  3. Offline

    KoryuObihiro

    Snippet would be like so:
    Code:
    Damage:
        - 'if event.hasrangedelement and projectile.type.arrow and attacker.type.player':
            - 'DO_SOMETHING'
    
     
  4. Offline

    Undectectable

    Having some bad problems :/ think my configs messed up
     
  5. Offline

    KoryuObihiro

    Depends on the build you're using. Docs are badly out of date right now, so if you're using and RC or Test Build then it's more than likely.
     
  6. Offline

    Undectectable

    yeah i know dont worry :) just reloaded 5-6 times and started up again haha
     
  7. @KoryuObihiro

    Hi! I'm back again and i think i will start testing and using this plugin again.
    Which version of bukkit do you "support" with your dev-versions at the moment?

    Oh another question:

    I know you can't/won't control "Burns in sunlight", but is there a chance to reduce the damage mobs become from sunlight(fire) to zero (0) ?
    As a simple code-part another plugin is using, this will do it:
    Code:
        private static boolean performInSunlightCheck(LivingEntity entity) {
            World world = entity.getWorld();
    
            Difficulty difficulty;
            //System.out.println("use region: "+ Manager.useRegion(world, "burnsInSunlight"));
            if( Manager.useRegion(world, "burnsInSunlight") )
                difficulty = Manager.getDifficulty(entity);
            else
                difficulty = Manager.getDifficulty(world);
    
            if (difficulty == null) {
                //System.out.println("Difficulty = null!");
                return DifficultyDefaults.burnsInSunlight(entity);
            } else
                //System.out.println("difficulty for "+entity.getClass().getSimpleName()+": "+difficulty.getName());
    
            if (difficulty.burnsInSunlight(CdCreatureType.valueOf(entity)) == 0
                    && CreatureInfo.isInSunlight(entity)) {
                entity.setFireTicks(0);
                return true;
            } else
                return false;
        }
    And one wish (i already posted it as a suggestion, but):
    Could you add Factions support? :)
     
  8. Offline

    KoryuObihiro

    You could potentially reduce day burn damage...probably similar to this snippet:
    Code:
    Alias:
        Element:
            undead:
                - 'Zombie'
                - 'Skeleton'
                - 'ZombiePigman'
    Damage:
        - 'if target.type._undead and event.time.lessthan.14000 and attacker.type.burn and target.isexposedtosky': '-1'
    
    As for the Factions plugin, I know very little about it - what sort of integrations did you have in mind?
     
    Terra-Network.org likes this.
  9. Your posted code sounds good, i will test it!

    I have two or three stages in mind.

    The most important for me would be: Spawncontrol
    (Are mobs allowed to spawn inside a faction or not)
    The second would be: Strength
    Control HP and Damage of Mobs
    The third: Faction Relations
    Control damage players of different factions deal to each other.

    Forget the last two points, the first would be more than great for the beginning :)
     
  10. Offline

    Rurikar22

    I can't seem to find it in the config, but...

    Is there a way to go about changing how much damage blocking with your sword does? At the moment using mod damage just seems to make blocking useless and I can't seem to find anything about implementing block.
     
  11. Offline

    KoryuObihiro

    Added to the tracker.

    There's currently no method I know of determining this, and unfortunately it's a Bukkit problem - no plugin can currently check whether they're blocking or not. I can see why this might be frustrating. :\

    As soon as the Bukkit team get around to doing it, then it'll get done - but in the meantime, I'll put it in the issue tracker so it's not forgotten.
     
    Terra-Network.org likes this.
  12. The two links for the RC version and for Jenkins are down (404).
     
  13. Offline

    Rurikar22

    Awesome, i'll work around it for now. Thanks a bunch!

    Is there an "Else" command or a way to define "everything else" I want to basically disable every other weapon except for bow for a group of players and can't seem to find a syntax to do it other then defining every single item besides bow.

    Code:
        - 'if attacker.type.human':
            - 'if attacker.group.class_ranger':
                   - 'set.0'
    
        - 'if attacker.type.human':
            - 'if attacker.group.class_ranger':
                - 'if projectile.type.arrow':
                   - 'set.19'
    Basically what I'm trying to do.

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

    KoryuObihiro

    I swear I've typed this response out three times now, and for some reason or other IRL manages to interrupt before I can hit "Post Reply".

    Anyway. There's two ways to do what you want here.

    Code:
    - 'if attacker.type.human':
        - 'if attacker.group.class_ranger':
            - 'set.0'
            - 'if projectile.type.arrow': 'set.19'
    
    This is the simplest way to do it. For exclusive logical branching, however, you'd need a Condition switch:

    Code:
    - 'if attacker.type.human':
        - 'if attacker.group.class_ranger':
            - 'switch.condition':
                - 'projectile.type.arrow': 'set.19'
                - '!projectile.type.arrow':  'set.0'
    
    The latter's really sort of silly-looking here, because you only have a simple if/not situation - there's no "else" in ModDamage. You just have to be creative.

    As for everybody who's encountered the broken links: I've been aware of the situation, but finals have prevented me from doing much - I'll get on it as soon as I can later today.
     
  15. Offline

    KoryuObihiro

    Apologies for the broken link! The RCs are available again, and I'll likely be pushing another soon, for stability only.
     
  16. Offline

    KoryuObihiro

  17. Offline

    KoryuObihiro

    Alright, everyone, I've got a plea for those who care about keeping MD alive.

    So, in two weeks, I leave to go on a mission - I'm one of them Mormon boys who do that. I promise to you that by the time I'm gone, I'll have everything documented properly and gotten the code and a release as stable as I can possible get it. At this point, ModDamage will shift to 1.0.

    Alas, this does not provide assurance for future updates. I won't be around to keep this plugin up - and I need maintainers! If you are a Java dev or know anyone that is, please refer them to this project! I don't want to see this plugin die!
     
  18. @KoryuObihiro

    One question: How do you handle the HealthPoints of Creatures, because they are hardcoded in Minecraft?

    @KoryuObihiro

    Yeah that's what i thougt:

    Code:
    2011-12-15 15:07:28 [SEVERE] Could not pass event CREATURE_SPAWN to ModDamage
    java.lang.IllegalArgumentException: Health must be between 0 and 10
        at org.bukkit.craftbukkit.entity.CraftLivingEntity.setHealth(CraftLivingEntity.java:42)
        at com.KoryuObihiro.bukkit.ModDamage.ModDamageEventHandler$ModDamageEntityListener.onCreatureSpawn(Unknown Source)
        at org.bukkit.plugin.java.JavaPluginLoader$72.execute(JavaPluginLoader.java:767)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callCreatureSpawnEvent(CraftEventFactory.java:259)
        at net.minecraft.server.World.addEntity(World.java:883)
        at org.bukkit.craftbukkit.CraftWorld.spawn(CraftWorld.java:820)
        at org.bukkit.craftbukkit.CraftWorld.spawn(CraftWorld.java:655)
        at org.bukkit.craftbukkit.CraftWorld.spawnCreature(CraftWorld.java:323)
        at com.sk89q.commandbook.commands.FunCommands.spawn(FunCommands.java:115)
        at com.sk89q.commandbook.commands.FunCommands.spawnMob(FunCommands.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sk89q.minecraft.util.commands.CommandsManager.invokeMethod(CommandsManager.java:455)
        at com.sk89q.minecraft.util.commands.CommandsManager.executeMethod(CommandsManager.java:448)
        at com.sk89q.minecraft.util.commands.CommandsManager.execute(CommandsManager.java:348)
        at com.sk89q.commandbook.CommandBookPlugin.onCommand(CommandBookPlugin.java:266)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:165)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:378)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:757)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:722)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:715)
        at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:180)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:93)
        at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:550)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:527)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:425)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
    Mojang hardcoded the health-value.
    Before you spawn a mob, you surely use "setHealth(value)"
    If value is higher than the allowed value (use: entity.getMaxHealth() ) it will throw this error.
    Either you will do a comparison with getMaxHealth, but this will reduce the feature to set mobs health higher than normal, or you have to use a CustomEntity event.
    I can provide you two links for this problem:
    http://forums.bukkit.org/threads/solved-need-some-help-with-extending-off-of-entityzombie.46564/
    http://forums.bukkit.org/threads/changing-maximum-entity-health.48175/#post-834802

    I hate this, but what should we do ...
    The easiest way (i know you remaining lime is limited) would be to get MaxHealth and limit the player value, this works great.
    If you find the time you could rewrite the Entitys with Custom Entitys :(

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 15, 2016
  19. Oh and i'm getting this, too:

    Code:
    2011-12-15 22:04:35 [SEVERE] Error occurred while enabling ModDamage v0.9.6 test build 102 (Is it up to date?): null
    java.lang.NullPointerException
        at com.KoryuObihiro.bukkit.ModDamage.Backend.Aliasing.Aliaser.load(Unknown Source)
        at com.KoryuObihiro.bukkit.ModDamage.Backend.Aliasing.AliasManager.reload(Unknown Source)
        at com.KoryuObihiro.bukkit.ModDamage.ModDamage.reload(Unknown Source)
        at com.KoryuObihiro.bukkit.ModDamage.ModDamage.onEnable(Unknown Source)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:188)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:968)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:186)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:169)
        at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:348)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:335)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:165)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:399)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
     
  20. Offline

    KoryuObihiro

    LOL, I'd already solved this problem a week ago by reintroducing EntityHealth.
     
  21. Oh ok, then i need a newer version?
     
  22. Offline

    mensrea

    So theres a mod called industrial craft 2 and in it there is an armor called the Quantum Suit. It is a very OP armor and I am looking into how I can nerf it. Would the following lines be sufficient?

    Damage:
    - 'switch.attacker.type':
    Player:
    - 'if target.wearing.30173': //the 30173 is the item number of the quantum chestplate
    - '10'

    All I'm trying to do is make it so if you get hit by another player while wearing a quantum chestplate you will take 10 extra damage. Will this work? If it does, will it apply to both melee and ranged damage?
     
  23. Offline

    KoryuObihiro

    The problem with this mod is that Bukkit doesn't support it - and I can't guarantee it'll play nice with it. But if it doesn't, then yes, it will affect melee and ranged, because the only condition you've set is that the target is wearing something.

    Also, an MD grammar note: "10" needs to be indented to be under the wearing conditional, though the whitespace may have simply been hidden because you didn't use a [ code ] block.
     
  24. Offline

    Mixmaster1190

    Your github 404'd.
     
  25. Offline

    KoryuObihiro

    Fixed.
     
  26. Offline

    mensrea

    My config file is not "automagically" generating. Is this a fatal error or can I just download some config off sourceforge or something?

    Also, the mod I was talking about (IC2) was ported to bukkit. Assuming I can even get this plugin to work at all (probably some conflict) would it still likely not be able to affect the damage event?
     
  27. Offline

    KoryuObihiro

    How does it introduce a new type of item? Does it just use pre-existing ones, i.e., the chainmail armor?

    This error has been fixed - if you want to use your current build, try deleting the ModDamage folder itself. I'll promote a new RC build today, but I'll have another major release done hopefully in the next five hours or so. It'll be documented and everything. :D
     
  28. Offline

    mensrea

    I'm not really sure how it adds new items. I do know that the item ID's for the mod go above the ones that vanilla MC uses - it does not overwrite anything.
     
  29. Offline

    KoryuObihiro

    Well...shoot. I'm out of time for development. I officially can't contribute to MD's development for two years.

    I'm going to see if I can't get this thread closed - please direct your attention to the BukkitDev project for further questions and updates!
     
  30. Offline

    1cec0ld

    Can anyone attest to a performance of build #102 on CB 1597? PEX most updated, Even run on minimal plugin capacity, I still have errors before it evenreads my config. I realize the dev just ^ recently left, I've also spent the last 5 hours reading this thread and gaining respect for its participants, but I was wondering if any of the remaining users have any reports on 1.0.1 . Thanks for any input.
    On another note, I'd be happy to use the Stable Build, if it would read my PEX groups on startup. Otherwise, it has no errors on startup or anything. Even reads and applies damage, just won't read an apply a group name to save its life.
    Config:
    Show Spoiler
    Code:
    Aliases:
        Armor:
        Biome:
        Condition:
        Element:
        Item:
        Group:
        Material:
        Message:
        Region:
        Routine:
        World:
    #Events
    Damage:
        - '8'
        - 'if attacker.group.fire and target.group.air':
            - 'mult.2'
            - 'message.attacker.Critical Hit For Fire'
        - 'if attacker.group.Air and target.group.Earth':
            - 'mult.2'
            - 'message.attacker.Critical Hit For Air'
        - 'if attacker.group.Earth and target.group.Water':
            - 'mult.2'
            - 'message.attacker.Critical Hit For Earth'
        - 'if attacker.group.Water and target.group.Fire':
            - 'mult.2'
            - 'message.attacker.Critical Hit For Water'
    Death:
    Food:
    ProjectileHit:
    Spawn:
    Tame:

    PEX Groups:
    Show Spoiler

    Code:
    groups:
        defaulto:
            prefix: '&f'
            permissions:
            - mcmmo.commands.party
            - snip
            - essentials.home
            options:
                rank: '10'
            inheritance: null
        Earth:
            suffix: ' of &2Earth'
            options:
                rank: '4'
            inheritance:
            - defaulto
            permissions:
            - mcmmo.grant.excavation
            - snip
            - essentials.warp.earth
        Water:
            suffix: ' of &1Water'
            permissions:
            - magicspells.grant.frostwalk
            - snip
            - healingwater.mode.aquatic
            options:
                rank: '5'
            inheritance:
            - defaulto
        Fire:
            suffix: ' of &4Flame'
            permissions:
            - mcmmo.grant.unarmed.repair
            - snip
            - healingwater.damage.2
            options:
                rank: '2'
            inheritance:
            - defaulto
        Air:
            suffix: ' of &7Air'
            options:
                rank: '6'
            inheritance:
            - defaulto
            permissions:
            - mcmmo.skills.swords
            - snip
            - essentials.warp.air
    

    Relevant StackTrace with test (Stable has no errors, just blind to groups):
    Show Spoiler

    Code:
    2011-12-28 14:50:58 [INFO] [ModDamage] v0.9.6 test build 102 loading...
    2011-12-28 14:50:58 [INFO] [ModDamage] Permissions: PermissionsEx v1.17
    2011-12-28 14:50:58 [INFO] [ModDamage] Verbose debugging active.
    2011-12-28 14:50:58 [INFO] Loading aliases...
    2011-12-28 14:50:58 [WARNING] Warning: nothing found for "Armor"
    2011-12-28 14:50:58 [INFO] Armor aliases found, parsing...
    2011-12-28 14:50:58 [SEVERE] Error occurred while enabling ModDamage v0.9.6 test build 102 (Is it up to date?): null
    java.lang.NullPointerException
    at com.KoryuObihiro.bukkit.ModDamage.Backend.Aliasing.Aliaser.load(Unknown Source)
    at com.KoryuObihiro.bukkit.ModDamage.Backend.Aliasing.AliasManager.reload(Unknown Source)
    at com.KoryuObihiro.bukkit.ModDamage.ModDamage.reload(Unknown Source)
    at com.KoryuObihiro.bukkit.ModDamage.ModDamage.onEnable(Unknown Source)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:188)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:968)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:186)
    at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:169)
    at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:348)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:335)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:165)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:399)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
     

Share This Page