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

    KoryuObihiro

    Well, here's a basic structure to help you with those conditions you describe using switch statements:
    Code:
    Damage:
        - 'switch.target.type':
            player:
                - 'switch.attacker.type':
                    mob: '2' #More damage
                    fall:
                        - 'if target.wearing.LEATHER_BOOTS': '-3' #leather boots-> less fall damage
                    explosion:
                        - 'if target.wearing.LEATHER_HELMET': '-3' #leather helmet -> less explosion damage
                    player:
                        - 'if event.hasrangedelement': '-1' #reduce ranged damage
            mob:
                - 'switch.attacker.type':
                    player: '-2' #Less damage
                    burn:
                        - 'set': '0'
    
    To contrast, here's just straight-up conditionals:

    Code:
    Damage:
        - 'if target.type.player':
            - 'if attacker.type.mob': '2' #More damage
            - 'if attacker.type.fall':
                - 'if target.wearing.LEATHER_BOOTS': '-3' #leather boots-> less fall damage
            - 'if attacker.type.explosion':
                - 'if target.wearing.LEATHER_HELMET': '-3' #leather helmet -> less explosion damage
            - 'if attacker.type.player':
                - 'if event.hasrangedelement': '-1' #reduce ranged damage
        - 'if target.type.mob':
            - 'if attacker.type.player': '-2' #Less damage
            - 'if attacker.type.burn':
                        - 'set': '0' #Sets the event value to 0.
    
    READ ME (open)
    Use a "spoiler" BBCode tag. :)


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

    Undectectable

    ok great that sould get me going i hope :) thank you very much is that exctly it pretty much? so i can use that but change bits of it? sorry im appaling at this normally have someone to help me :p
     
  4. @KoryuObihiro

    Hm just one question ... i used CustomDifficulty for a long time, but the dev ist more .. yeah inactive than active.
    One of the most interesting things, i still need, is to set:

    - is the mob passive, neutral or aggressive
    - does he burn in sunlight
    - where does he spawns (height, underground)

    Do you think you can at least build in the first two points?
     
  5. Offline

    KoryuObihiro

    You have control over the third with the Spawn routine and conditionals, technically.

    As for the other features, I might suggest CrowdControl.
     
    Terra-Network.org likes this.
  6. Ah ok, thanks! :)

    I see it needs elRegions, so it's not usable for me :/
     
  7. Offline

    KoryuObihiro

    Hmm...I could probably make a pull request for him on that.

    Want me to?
     
  8. Would be great, yeah!
     
  9. Offline

    Undectectable

    Hope the updates going well :)
     
  10. Offline

    KoryuObihiro

    I'm having a bit of irritation with maintaining a clean beta branch due to a little foolishness on my part with Github, but right now I've got a hopeful test build I'll be pushing once I get out of class. I'll post here when it's ready.
     
  11. Offline

    Undectectable

    Ahhh well done as i said test in on our server if you need :)
     
  12. @KoryuObihiro

    Could i use a weather event like rain?
    I want to add some kind of "acid rain", which hurts players.
     
  13. Offline

    KoryuObihiro

    Hmmm......this is an interesting concept, but I don't know how feasible it'd be with the current roadmap for 0.9.6. In 0.9.7/8, I'll be trying to add dynamic aliasing, or "tagging", which might let you do this....Hmm...I'll have to think about that one.

    In short, not right now. :p
     
    Terra-Network.org likes this.
  14. Offline

    lucent

    Speaking on this topic, even though it may be out of scope for MD to create damage events, one could ostensibly create a simple Acid Rain mod for themselves (is raining? is exposed to sky? HURT U). But this brings up something I've been thinking about for a little while: would it be tough to catch damage events, and if they're Type.CUSTOM, use the getEventName() flag to modify their damage within MD? Maybe to clarify what I mean, a pseudo-MD config would help:

    Code:
    Damage:
        - 'if event.custom.AcidRain':
            - 'if target.biome.SWAMP':
                - 'set.2'
                - 'target.message.OH GOD IT BURNS'
    
    Basically, if a modder made their damage event lower priority than your listener and made the event names transparent to users, they would have instant compatibility! Things like acid rain could be easily extended via your upcoming regions support, too (really looking forward to that!).
     
  15. Offline

    KoryuObihiro

    I've considered making a custom MD events API, but I simply don't know how interested people would be in calling.
     
    MuttsNuts likes this.
  16. Offline

    nemanja

    Will you update to 1.8 (1185) soon? This plugin is a big part of my server :)
     
  17. Offline

    KoryuObihiro

    Gaaah, sorry, I don't mean to make you guys wait. I have a lot of studying to do, so development has been hit and miss for the last couple of days, but I have a relatively stable build that I'll post on Github.

    Grr. Forgot to actually do that. :(
     
    nemanja likes this.
  18. Can i add a configuration for creepers doing damage to players and mobs, but not to the environment (blocks) ?

    @KoryuObihiro

    I'm getting these error:
    (CB 1185)

    Code:
    2011-09-25 07:33:54 [SEVERE] Could not pass event ENTITY_DAMAGE to ModDamage
    java.lang.NullPointerException
        at com.KoryuObihiro.bukkit.ModDamage.RoutineObjects.Conditional.EntityTypeEvaluation.condition(EntityTypeEvaluation.java:23)
        at com.KoryuObihiro.bukkit.ModDamage.RoutineObjects.ConditionalRoutine.run(ConditionalRoutine.java:35)
        at com.KoryuObihiro.bukkit.ModDamage.ModDamageEntityListener.onEntityDamage(ModDamageEntityListener.java:49)
        at org.bukkit.plugin.java.JavaPluginLoader$61.execute(JavaPluginLoader.java:670)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
        at net.minecraft.server.Entity.aa(Entity.java:268)
        at net.minecraft.server.EntityLiving.aa(EntityLiving.java:124)
        at net.minecraft.server.Entity.s_(Entity.java:192)
        at net.minecraft.server.EntityLiving.s_(EntityLiving.java:268)
        at net.minecraft.server.EntityMonster.s_(EntityMonster.java:31)
        at net.minecraft.server.World.entityJoinedWorld(World.java:1193)
        at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:48)
        at net.minecraft.server.World.playerJoinedWorld(World.java:1175)
        at net.minecraft.server.World.cleanUp(World.java:1090)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:460)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    There were another one mit ENTITY_HEALTH, but i can't find it at the moment.
     
  19. Offline

    KoryuObihiro

    Yeah, pretty sure I've fixed this in the current 0.9.6 dev builds - right now unfamiliar MD Elements are returned as null in the code, and it causes some problems. I'll be posting the Beta commits and an according JAR in Github right now, see if it doesn't fix your problem.

    0.9.6 Beta JAR for download here.

    I know it's been awhile, but I think you'll find the updates have been worth it! I'm continually updating the changelog here in the form of a Gist here.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 15, 2016
  20. I just ask again, because i think the error message was to long ^^

    @KoryuObihiro

    Can i add a configuration for creepers doing damage to players and mobs, but not to the environment (blocks) ?
    I know there are plugins, but maybe it's simple to do with MD

    When i hit a mob:

    Code:
    2011-09-26 17:27:42 [SEVERE] Could not pass event ENTITY_DAMAGE to ModDamage
    java.lang.ClassCastException: ru.tehkode.permissions.bukkit.PermissionsEx cannot be cast to com.nijiko.permissions.PermissionHandler
        at com.KoryuObihiro.bukkit.ModDamage.ExternalPluginManager$PermissionsManager.getGroups(ExternalPluginManager.java:208)
        at com.KoryuObihiro.bukkit.ModDamage.Backend.AttackerEventInfo.<init>(AttackerEventInfo.java:35)
        at com.KoryuObihiro.bukkit.ModDamage.ModDamageEntityListener.onEntityDamage(ModDamageEntityListener.java:56)
        at org.bukkit.plugin.java.JavaPluginLoader$61.execute(JavaPluginLoader.java:670)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
        at net.minecraft.server.EntityHuman.d(EntityHuman.java:710)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:915)
        at net.minecraft.server.Packet7UseEntity.a(SourceFile:33)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
        at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:500)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:464)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    Aaaaand another one, when typing "md check"

    Code:
    2011-09-26 17:35:23 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'md' in plugin ModDamage v0.9.6 BETA
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:41)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:163)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:353)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:756)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:721)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:714)
        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:92)
        at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:500)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:464)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    Caused by: java.lang.ClassCastException: ru.tehkode.permissions.bukkit.PermissionsEx cannot be cast to com.nijiko.permissions.PermissionHandler
        at com.KoryuObihiro.bukkit.ModDamage.ExternalPluginManager$PermissionsManager.hasPermission(ExternalPluginManager.java:224)
        at com.KoryuObihiro.bukkit.ModDamage.ModDamage.onCommand(ModDamage.java:331)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:39)
        ... 13 more
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 15, 2016
  21. Offline

    KoryuObihiro

    Not enough information, dude. I need what RB you're using, what version of MD, steps to reproduce. ;)
     
  22. Moah i'm sry ^^

    RB 1185
    MD 0.9.6b
    PermissionEx 1.14
    Spout 1.0.6

    Steps to reproduce:

    - Start the Server -> everything fine
    - Login, spawn a creature -> everything fine
    - Hit the Creature (pig) with Diamond Sword -> one hit (it's ok so, cause of dmg)
    - Spam at server-console, saying [first error log]

    - Gave me the node "moddamage-check" (also tried without it)
    - Typed command: /md check -> Ingame error message "An internal error occured while attempting to perform this command"
    - Spam at server-console, saying [second error log]
     
  23. Offline

    Undectectable

    Hey buddy. Sorry the provider broke the server a lot. If you message me a username/password ill make another accout for you for the modding :)
     
  24. Offline

    KoryuObihiro

    Ooh, I see the problem. Strange...I'll have to do a little tweaking to get that to work, but it looks like I just have an old dependency that's messing stuff up for PEX. I'll see if I can't fix that soon.


    Can do.
     
  25. I hope you will fix it soon :)
    I want to work on my config again, but with these errors it's hard ^^

    When i trief your beta-version, some more errors occured:

    Code:
    2011-09-26 18:17:23 [INFO] [ModDamage] 0.9.6 BETA enabled [PermissionsEx v1.14 active]
    2011-09-26 18:17:23 [INFO] [ModDamage] "Quiet" mode active - suppressing noncritical debug messages and warnings.
    2011-09-26 18:17:23 [SEVERE] No matching Element alias or value "ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Error: bad statement "target.type.ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if target.type.ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if attacker.wielding.AIR"
    2011-09-26 18:17:23 [SEVERE] No matching Element alias or value "ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Error: bad statement "target.type.ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if target.type.ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if attacker.wielding._sword"
    2011-09-26 18:17:23 [SEVERE] No matching Element alias or value "ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Error: bad statement "target.type.ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if target.type.ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if attacker.wielding._axe"
    2011-09-26 18:17:23 [SEVERE] No matching Element alias or value "ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Error: bad statement "target.type.ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if target.type.ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if attacker.wielding.BOW"
    2011-09-26 18:17:23 [SEVERE] No matching Element alias or value "ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Error: bad statement "target.type.ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if target.type.ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if attacker.wielding._hoe"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if attacker.wearingonly.LEATHER_HELMET*LEATHER_CHESTPLATE*LEATHER_LEGGINGS*LEATHER_BOOTS"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if attacker.wearingonly.IRON_HELMET*IRON_CHESTPLATE*IRON_LEGGINGS*IRON_BOOTS"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if attacker.wearingonly.GOLD_HELMET*GOLD_CHESTPLATE*GOLD_LEGGINGS*GOLD_BOOTS"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if attacker.wearingonly.DIAMOND_HELMET*DIAMOND_CHESTPLATE*DIAMOND_LEGGINGS*DIAMOND_BOOTS"
    2011-09-26 18:17:23 [SEVERE] Error - couldn't match event property "time"
    2011-09-26 18:17:23 [SEVERE] Error: bad statement "event.time.lessthan.14000"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if event.time.lessthan.14000"
    2011-09-26 18:17:23 [SEVERE] No matching Element alias or value "ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Error: invalid case "Player"
    2011-09-26 18:17:23 [SEVERE] Error: invalid case "ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Error: invalid case "Wolf_Wild"
    2011-09-26 18:17:23 [SEVERE] Error: invalid Switch "switch.attacker.type"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if target.wearingonly.LEATHER_HELMET*LEATHER_CHESTPLATE*LEATHER_LEGGINGS*LEATHER_BOOTS"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if target.wearingonly.IRON_HELMET*IRON_CHESTPLATE*IRON_LEGGINGS*IRON_BOOTS"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if target.wearingonly.GOLD_HELMET*GOLD_CHESTPLATE*GOLD_LEGGINGS*GOLD_BOOTS"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if target.wearingonly.DIAMOND_HELMET*DIAMOND_CHESTPLATE*DIAMOND_LEGGINGS*DIAMOND_BOOTS"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if target.type.Player"
    2011-09-26 18:17:23 [SEVERE] Error in Damage configuration.
    2011-09-26 18:17:23 [SEVERE] Error - couldn't match event property "time"
    2011-09-26 18:17:23 [SEVERE] Error: bad statement "event.time.lessthan.14000"
    2011-09-26 18:17:23 [SEVERE] Invalid Conditional "if target.exposedtosky and event.time.lessthan.14000"
    2011-09-26 18:17:23 [SEVERE] No matching Element alias or value "ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Error: invalid case "ZombiePigman"
    2011-09-26 18:17:23 [SEVERE] Error: invalid case "Wolf"
    2011-09-26 18:17:23 [SEVERE] Error: invalid Switch "switch.target.type"
    2011-09-26 18:17:23 [SEVERE] Error in Spawn configuration.
    2011-09-26 18:17:23 [INFO] One or more errors occurred while loading routines.
    2011-09-26 18:17:23 [INFO] [ModDamage] Loaded configuration with one or more errors.
    It's the same config like the one working with 0.9.5, so i think there is another mistake.
    What versions i used: 2 posts above ^^
    When it happened: Serverstart
     
  26. Offline

    KoryuObihiro

    Hmm...alright, yeah, I can see where I've broken some things. Try the following:

    1) Rename all ZombiePigman references to PigZombie

    2) Rename "event.time" to "world.time"

    Beyond that, it seems I've broken ArmorSet comparisons somehow...I'll get on that soon, hopefully. **gets back to taking class notes**
     
  27. Offline

    MuttsNuts

    Howdy!
    Is there a planned release for CB1185?
    I get a random [SEVERE] Could not pass event ENTITY_DEATH to ModDamage spam my server console since updating to CB1185 so I assume its something to do with that. On 1060 it ran flawlessly apart from my own lack of understanding on how to create a config file to do what I require of ModDamage :). I'm assuming as Permissions 2.7.4 support is currently broken, I was getting errors with "Damage:" when using for example, - 'if attacker.group.groupname.wielding.iron_sword' - 'set.2'
    Great plugin though. Has real potential in the right hands. I hope to find somebody that can unleash its potential on my server :).
    Thank you.
     
  28. Offline

    KoryuObihiro

    No problem! Yeah, there's a lot of plugin support I'm breaking, and some other stuff I've forgotten to document. The stacktrace you're getting is probably because of the new mobs, which aren't being handled very well...this has been changed so that it won't react so badly in the same situation in the future...but until I stabilize the features I'm currently putting out, I can't give you much of a timeframe for 0.9.6.

    Should be soon, though. **crosses his fingers**
     
  29. @KoryuObihiro

    How's the work going on?
    When do you think 0.9.6 will be available.
     
  30. Offline

    Brvtvs

    What's up? I am back! Hope to see the updated version soon!
     

Share This Page