mcMMO-Dev / mcMMO

The RPG Lover's Mod!
https://mcmmo.org
GNU General Public License v3.0
1k stars 862 forks source link

Unarmed damage does not benefit from vanilla minecraft crits #5056

Open MrJezyk opened 1 month ago

MrJezyk commented 1 month ago

As you probably know, in minecraft when you hit an enemy while falling or on the downward portion of your jump you do a critical hit that deals 50% extra damage.

For some reason the bonus damage from unarmed levels is not affected by these crits. When critting mobs it deals the same damage as a normal hit with unarmed.

nossr50 commented 1 month ago

There's nothing in the code that I can think of that would affect this, unless unarmed attacks don't benefit from crits in vanilla?

MrJezyk commented 1 month ago

I've looked into it a little and it appears bonus damage from enchantments does not benefit from crit damage (but bonus damage from strength does).

So for example an unenchanted diamond sword does (1 + 7) = 8 damage an unenchanted diamond sword crit deals ((1 + 7) 1,5)= 12 damage sharpness V diamond sword deals ((1 + 7) + 3)= 11 damage sharpness V diamond sword crit deals ((1 + 7) 1,5 + 3)= 15 damage sharpness V diamond sword with strength 2 crit deals (((1 + 6) + 7) * 1,5 + 3) = 24 damage In this last formula the 1 is the base damage, the 6 is the extra base damage from strength, the 7 is the bonus damage from the sword, the 1,5 multiplier is from the crit and the 3 bonus damage is from the enchantment.

In this example I used a diamond sword but the same goes for unarmed except it doesn't have the +7 bonus the diamond sword gets.

I guess the extra damage gained from unarmed counts as enchantment damage instead of increasing the empty hands base damage.

I don't really know if this can be fixed but I figured I'd at least inform you