
[1.12.2] If damage taken is 50+ you only gain 1 XP for Armor. Might also affect Weapons?
SonicX8000 opened this issue ยท 12 comments
In "EnhancedArmaments-1.3.9.jar" change log I saw...
-Fixed armor level up to max level by taking a massive damage
Not sure if this is the cause but there's a side effect of making it so you only gain 1 XP if damage is high enough which appears to be 50+. This could conflict with mods that alters the damage taken, such as Scaling Health's Damage Source Scaling.
Could be tweaked by setting a max gained XP in which any XP over that value will become lost instead of dropping it to 1. For example...
Maximum gained XP is 200, item gains 250 XP. Item will only get 200 XP and the rest is lost due to the value being set at 200.
Maximum XP is 500, item gains 50000 XP... somehow. Item only gets 500 XP and the rest is lost due to the value being set at 500.
This could be a configurable option now thinking about it.
im gonna look into it. still not sure how a player have larger than 55 hp... but i will satisfy you.
Well... there are mods that can increase Health over the default 20. To name a few...
Botania has the Ring of Odin that adds 10 Hearts (20 Health) when worn.
Aether Legacy has Life Shards that adds 1 Heart (2 Health) per use up to a maximum of 10 Hearts (20 Health) although configurable to allow more if you wanted.
Scaling Health allows you to gain Health by using Hearts, can also gain health if you have your XP at a certain value, both which are configurable, also has Damage Source Scaling so the extra health can be helpful as the difficulty rises.
Just making it compatible, that's all.
I still think that only awarding 1 XP for the high damage taken & surviving is off putting as if the damage is reduced by Armor/Protection or other defense factors it'll only award you 1 XP for your Armor if the damage was higher than your max health. Here's an example...
With the default 10 Hearts (20 Health), you can survive getting nuked by a Charged Creeper on Easy Mode with a full set of Diamond Armor with Protection IV on all of the pieces. If you get dead center on the Creeper as it explodes... you take 40 Damage. My Armor gets only 1 XP due to the damage being above 20 Health.
On Normal a Charged Creeper can instant kill you as being in the center of the explosion deals 81 Damage with a Full Set of Diamond Armor + Protection IV on all pieces, but I had a Totem of Dying in my off-hand which revives me. My Armor still gets 1 XP since the damage was above 20 Health.
Now here's one other example using the 'Scaling Health' mod which allows me to alter the damage sources such as setting 'mob' to 5.0 with a difficultly weight of 0.05 which increases the damage taken from a Mob's Melee Damage depending on the difficulty.
I set the difficulty to 50 along with my Health to 50 hearts (100 Health) while still wearing the same Diamond Armor + Protection IV with Vanilla's Difficulty on Hard Mode since that affects Vanilla Mob's damage output. I changed the 'mob' damage source to 5.0 with a a weight of 0.05 and I let a Zombie Pigman attack me and this is the damage it dealt... according to the log that Scaling Health's Debug Info prints out.
"Damage scaling: type=mob, scale=5.0, affected=2.5, change=150.0, original=12.0"
The XP rewarded for the Armor...? 1 XP, because 150 damage was above my max health which is 100 despite surviving with 58 health remaining.
I think this was put in because '/kill' gave a lot of Armor XP? Looking at this issue that was reported a few days ago although no mention of what version of the mod he was using as well as any other mods.
You could still cap the XP if you wish but 1 XP is too low. The configurable Max Gained XP that I mentioned would be a better option in which if the Max Gained XP value is set at 300 and you gain 450 XP, 150 of that XP is lost and only 300 is gained, rather that just penalizing the player with 1 XP. Even if you gained 1000 XP due to the Damage Scaling... you would still only get 300 XP.
EDIT
I took a look at a older version of your mod before you added an XP cap for the Armor. Just to check something out.
EnhancedArmaments-1.3.8
The command '/kill' doesn't even award XP for the Armor in that version, I was wearing a newly crafted Diamond Chestplate. Did it 5 times and it still says 'Level 1 - 0/60' with the default config. Got hit by a Zombie which gave me 4 XP on my Diamond Chestplate and then /kill and still still says 4/60 XP.
Although certain high damage sources can reward XP still and deal insane damage. The cyberware mod comes to mind where if you remove vital body parts like your Bones, it'll deal 2.14748365E9 damage which floors XP on Armor to max. Max gained XP would keep that in check.
I understand that, but even if the damage was slightly over his max health despite being reduced by defense factors such as Protection/Resistance and surviving... he'll still be penalized with just 1 XP.
i know that too, then i consider adding a value of armor count into his max hp. for example, a player has 20 hp, and 10 armor. the addition is 30, and if the taken damage is 25 (example from creeper) he will stay alive and get his experience. i think this could fix the issue completely.
Would that take into account for Protection Enchantments & the Resistance Potion effects?
I wore full set of diamond armor, and my armor value was 20. This means that value gonna be 40 if the player has full HP with diamond armor set. And that value won't be affected by any enchantments or potions. This is a real fix for this issue.
/kill command does "fell out world(void)" damage and it's not allowed to gain experience for your armors, it's purposefully done by me.
And if the player gonna take a damage larger than his HP, it will be so stupid that his armor get experienced from that. He should be alive to gain experience for his armor. This is the point.
It's... not really a real fix if you don't take into account for the player using Protection / Resistance or other defensive means. As it is currently, you are punishing the player for having Protection & Resistance or other defensive means after taking massive damage which is heavily reduced & surviving by only rewarding them with 1 XP.
In Vanilla it... kinda works, sure... but I have this mod + other mods added to give it an RPG-like style with the increased health & difficulty as you move further from spawnpoint or just by spending some time in the world and because of the increased damage being taken even though it is reduced through other defensive means not only related to armor... I'm only ever going to get 1 XP mostly... if not all the time despite surviving.
Honestly... the 'Maximum gained XP ' suggestion that I mentioned will fix this issue completely, it wouldn't even be overpowered nor underpowered as the value that it's set at will only allow that much XP to be gained no matter how high the damage is rather that outright reduce it to 1 XP which is what you have it at currently and users can adjust that value as needed to balance it out.