ChangeDamage
ChangeDamage by FalseVacuum
NOTE: I don't play MineCraft anymore. Please don't ask for new features. They're not going to happen.
Sorry guys, updates are *very* slow! I don't play MineCraft, and I'm super busy with other things. I do enough coding every day.... I would be thrilled to have someone to which to pass on the torch!
Up for takeover! PM me for details.
Features
- Item/weapon damage
- Arrow damage
- Critical damage
- Strength effect
- Weakness effect
- Separate world configurations for damage output (all of the above features)
- Armor protection
- Fall damage (including armor protection during falling)
- Permission to decide if item/weapon damage changes based on the dealer. This also affects critical damage and the weakness and strength effects.
- Ability to configure item/weapon damage output for PvP only or for both PvP and PvE
- Default configuration so that you can avoid playing with things you don't understand yet.
- Responsive development team—I usually get back to you within 24 hours, and I get right on to bug reports.
- Open source
Overview
ChangeDamage is a plugin which allows you to change the damage an item does or the amount armor protects you. For example, you may want to make diamond swords more overpowered than they already are, increasing damage output to 20 (10 hearts). Or maybe you may want to nerf those OP diamond swords, so you decrease the damage output to 5 (2.5 hearts). Maybe, just for grins and giggles, you want the flower to do 200 damage. However you want it, that's how you can do it. You can also change the damage points of a piece of armor. You could buff the unobtainable chain armor, whilst nerfing the overpowered diamond armor!
So what ChangeDamage does is it allows you to change the damage output of any item. You can choose if this applies to PvP only or if this works for PvE. EvP will not be affected (for example, Zombie Pigmen's gold sword's damage output will be constant). It also changed the damage points of a piece of armor.
Commands
The current commands are:
- /changedamage reload - Reload the plugin
- /changedamage release - Disable the plugin (unload it, so you can remove it/replace it)
Future commands may include options to modify damage output of weapons from commands instead of from the text file
Config
- pvponly - true/false - If false, ChangeDamage will affect player versus entities (PvE) in addition to PvP. If true, ChangeDamge will only affect PvP
- verbose - true/false - If true, ChangeDamage will send you all sorts of useless spam messages that help me debug issues. Don't set this to true unless you know what you are doing.
- research - true/false - If true, ChangeDamage will occasionally print out some notes for me. Please report these notes if you get them. They will be marked "[ChangeDamage] [Research]" and will appear in the console. This is to investigate the possibility of adding critical hit support.
- damages - See "Damages", then see "Projectiles"
- armor - See "Armor Points"
- damages.expressions - Allows you to input an equation for how much damage a critical hit does. Variable 'n' is the amount of damage done by the player, rounded down to the nearest even number. Use the subnodes of "damages.expressions" "strength", "weakness", and "critical" to affect damage output for strength effect, weakness effect, and critical damage, respectively. See "Expressions"
- fall - Allows you to decide fall damage. Only activated when the player falls more than 3 blocks. Variable 'd' is the distance fallen, rounded down to the nearest integer. Variable 'a' is the total armor points of the player. Use node "fall.expression" to specify damage. See "Expressions"
Permissions
The permissions nodes for this plugin are:
- vacuum.changedamage - Gives access to /changedamage
- vacuum.changedamage.damage - Default enabled. Disable to make damage output changes not be affected for this player.
Upcoming features
Color scheme:
- In progress
- Suggested
- Completed
These are features I want to add but have not yet done so:
- Change durability
- Armor color
- Mob effects when wearing certain armors (maybe)
- Automatic updating
- Modify enchantment power
- Change potion power
- Potion effect when attacking
PLEASE make suggestions. If it's something easy, you can be sure to find it in the next update!
Bugs
Color scheme:
- Unresolved
- Resolved but not in the current version
- Resolved
Bugs:
- ClassCastException caused by killing Ender Crystals
- Cannot use non-armor pieces as armor (causes an error when falling)
- NPE in arrow calculation
- Arrow permissions weren't working
- Critical damage didn't work
- When performing a critical hit, damage output was reducing
- The fall damage expression was being read from the wrong node
Download
To download the Bukkit approved version, click the "Download" link on the top right hand side of the page.
To download stable versions click here.
@UltrafaceGuy
You're fired :P
Nah, it's all good. It's not like I've actually fixed it. I'm too focused at work, and work is programming... don't want to burn out!
I'll get it done over the weekend.
@falsevacuum
I came here to alert you of the endercrystal bug, but was beaten to the punch!
DON'T DISOWN ME, I'LL DO BETTER NEXT TIME I SWEAR.
@Zefram
That was caused, I think, when someone killed an Ender Crystal. A rare event, but I'll put that on the bugs list.
1.76
[SEVERE] Could not pass event EntityDamageByEntityEvent to ChangeDamage
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
va:304)
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
a:62)
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
ava:460)
at org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDamageEvent(
CraftEventFactory.java:363
at org.bukkit.craftbukkit.event.CraftEventFactory.handleEntityDamageEven
t(CraftEventFactory.java:381
at org.bukkit.craftbukkit.event.CraftEventFactory.handleNonLivingEntityD
amageEvent(CraftEventFactory.java:389
at net.minecraft.server.EntityEnderCrystal.damageEntity(EntityEnderCryst
al.java:54
at net.minecraft.server.EntityHuman.attack(EntityHuman.java:750)
at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:917)
at net.minecraft.server.Packet7UseEntity.handle(SourceFile:33)
at net.minecraft.server.NetworkManager.b(NetworkManager.java:229)
at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:116)
at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:7
8)
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:567)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:459)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)
Caused by: java.lang.ClassCastException net.minecraft.server.EntityEnderCrystal
cannot be cast to net.minecraft.server.EntityLiving
at vacuum.changedamage.listener.DamageListener.applyEffects(DamageListen
er.java:277
at vacuum.changedamage.listener.DamageListener.entityDamaged(DamageListe
ner.java:200
at vacuum.changedamage.listener.DamageListener.entityDamagedNORMAL(Damag
eListener.java:130
at sun.reflect.GeneratedMethodAccessor229.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
va:302)
... 15 more
@Thomas2536
Protip: Couple this plugin with http://dev.bukkit.org/server-mods/moarrows/. I actually don't even use their extra arrows feature, but rather their penalties for wearing armors on bows. I made it so you do MUCH more damage with leather/chain/no armor, and much less with iron/diamond. These two together work wonderfully.
Oh and vikings are cool.
I thought making leather armor give u speed and things like that to make diamond armor not the only good armor. Thats my only idea...
It's working perfect for me now, thanks :)
@BotInPerson
I really would love to set up permissions nodes, but the question is implementation. I'm not sure how if I can dynamically create permissions nodes, although I will run some tests and see what I can do!
Hey! I really love your Plugin! It is exactly what we we're looking for. Our goal is to create different permissions groups who each do more damage with a specific weapon. For example the Vikings do more damage with axes than others. Also Vikings armor should be able to absorb more damage then others armor.. etc.. I looked through all of you pages and played around with the plugin .. but I sadly didn't quite get it to work. Could you maybe give me an example on how to set this up including permissions nodes.. For the Vikings maybe? :) I hope to hear from you soon! Big thanks in advance!
Update on the durability bit: I'm working on it, but I can give absolutely zero ETA. I need to figure out how MineCraft handles durability, which can be a bit confusing when things are labelled "a" and "b" 50% of the time. (as opposed to "setMaxDurability" or "damage")
Update: I have identified all of the ways that the damage value (thankfully labelled "damage") can change for a tool or sword, but not armor. I am struggling with the implementation, though (how I want to capture the event and be able to know how to handle it, not giving percentage chance of damage)
Update: For those of you who will understand this: I will capture BlockBreakEvents with MONITOR priority and subtract away the damage that should not have been done, or add extra damage that should have been done. The problem with this is that I don't know how I will handle if the item breaks.
@oopomopoo
That's really friggen weird. There shouldn't be any threads.
@Mayhem777
I don't think it was a loop, actually. The command error and the other error were two separate things. The other error was a harmless error caused during projectile calculations. There was also another error caused by when you didn't have a "default" item on a non-default world.
@oopomopoo
There's actually a method "setMaxDurability()" in Item which changes a "durability" field. ItemStack has a "damage" field, but I don't think it would be very wise to modify those too much. It might cause the client to become confused!
"You said earlier that there are no decimals. So will the text document not read any decimals? Such as if I have Leather armor and legs both set to 1.5, will the total come out to 2 or 3 on the server?"
Umm... I think it will throw a NumberFormatException. That depends on how Bukkit handles it. (I tell Bukkit to give me an integer, I don't know what they do to give it to me)
Edit: Also, each armor piece is handled separately and I don't handle it. I actually change the value of the item, so MineCraft does all of it's calculations with your numbers. Of course, I keep a backup of all of the values so that when the plugin is disabled, everything goes back to normal!
Loop error fixed? :D
@falsevacuum
oh wow thanks! But you don't have to hurry if you're busy. In theory though, you could theoretically alter the max durability by changing the amount of durability a weapon is deducted from use. For example if a Stone Sword loses 1 durability and has 100 durability, if you set it to lose .5 durability then the effective durability is 200. However this wouldn't work properly with mods that add a repair function to weapons for a cost, unless they increase the cost drastically. (Which is worth doing if this ends up working)
On a side note, I get an error when stopping the server. To my knowledge it has no effect on its performance when the server is running. (Yes it's up to date)
[SEVERE] Error occurred while disabling ChangeDamage v1.7.5 (Is it up to date?) java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(Unknown Source) at java.util.HashMap$KeyIterator.next(Unknown Source) at vacuum.changedamage.hooks.ArmorHook.restore(ArmorHook.java:43) at vacuum.changedamage.ChangeDamagePlugin.onDisable(ChangeDamagePlugin.java:467) at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217) at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:363) at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:400) at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:393) at org.bukkit.craftbukkit.CraftServer.disablePlugins(CraftServer.java:251) at net.minecraft.server.MinecraftServer.stop(MinecraftServer.java:409) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:489) at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)
-- Edit, quick question. You said earlier that there are no decimals. So will the text document not read any decimals? Such as if I have Leather armor and legs both set to 1.5, will the total come out to 2 or 3 on the server?@falsevacuum
Bugs fixed. Check 1.7.6 when it comes out. No durability yet.
The error (loop) its caused when any player hurts any mob or player... if i attack a zombie with "fists... swords..." doesn't matter . i get the error.
@UltrafaceGuy
Yeah, it would. I might implement that. There's something else out there that works like that, but I'm too groggy to remember what.
@Mayhem777
That looks like an infinite loop. You know cause and event? Imagine a cause causes an event which causes that same cause, which cases that same event which causes...
@Zefram
Flying fish? LOL (that's what unidentified projectile: org.bukkit.craftbukkit.CraftFish means - There's a fish that's flying through the air and going damage to you. Moreover, a player is throwing that fish, unless my projectile algorithms are off)
I'll add fish into the projectile list.
ChangeDamage v1.7.5
2012-07-06 17:36:40 [INFO] [ChangeDamage] Unrecognized projectile: class org.bukkit.craftbukkit.entity.CraftFish
2012-07-06 17:36:40 [SEVERE] java.lang.NullPointerException
2012-07-06 17:36:40 [SEVERE] at vacuum.changedamage.listener.DamageListener.entityDamaged(DamageListener.java:206)
2012-07-06 17:36:40 [SEVERE] at vacuum.changedamage.listener.DamageListener.entityDamagedNORMAL(DamageListener.java:127)
2012-07-06 17:36:40 [SEVERE] at sun.reflect.GeneratedMethodAccessor335.invoke(Unknown Source)
2012-07-06 17:36:40 [SEVERE] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2012-07-06 17:36:40 [SEVERE] at java.lang.reflect.Method.invoke(Unknown Source)
2012-07-06 17:36:40 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302)
2012-07-06 17:36:40 [SEVERE] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
2012-07-06 17:36:40 [SEVERE] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:460)
2012-07-06 17:36:40 [SEVERE] at org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDamageEvent(CraftEventFactory.java:363)
2012-07-06 17:36:40 [SEVERE] at org.bukkit.craftbukkit.event.CraftEventFactory.handleEntityDamageEvent(CraftEventFactory.java:381)
2012-07-06 17:36:40 [SEVERE] at net.minecraft.server.EntityLiving.damageEntity(EntityLiving.java:608)
2012-07-06 17:36:40 [SEVERE] at net.minecraft.server.EntityHuman.damageEntity(EntityHuman.java:595)
2012-07-06 17:36:40 [SEVERE] at net.minecraft.server.EntityPlayer.damageEntity(EntityPlayer.java:215)
2012-07-06 17:36:40 [SEVERE] at net.minecraft.server.EntityFishingHook.F_(EntityFishingHook.java:187)
2012-07-06 17:36:40 [SEVERE] at net.minecraft.server.World.entityJoinedWorld(World.java:1262)
2012-07-06 17:36:40 [SEVERE] at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:106)
2012-07-06 17:36:40 [SEVERE] at net.minecraft.server.World.playerJoinedWorld(World.java:1244)
2012-07-06 17:36:40 [SEVERE] at net.minecraft.server.World.tickEntities(World.java:1151)
2012-07-06 17:36:40 [SEVERE] at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:558)
2012-07-06 17:36:40 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:459)
2012-07-06 17:36:40 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)
Im' getting this one just installing it by default:
http://pastebin.com/Yshkc3id
When i use the comand /changedamage i get:
http://pastebin.com/AAne24Nd
And then infinite times:
http://pastebin.com/79H4GreE
@falsevacuum
Could you add, say, a percentage for which durability is not effected so on average you would have the illusion or increased durability?
So say DIAMOND_HAT_DURA: 10 would just have a 10% chance of not losing durability. You could double durability by setting this to 50, and go all the way up to 99 for 100x durability, or 100 for losing none at all.
Would that even work? @_@