SlimeVoid / TheMinersFriend

The Miner's Friend Mod
GNU Lesser General Public License v3.0
1 stars 0 forks source link

Entity Damage hiting an Entity #46

Closed Eurymachus closed 10 years ago

Eurymachus commented 10 years ago

Currently Entity damage is done through DamageSource and Item.getAttributeModifier() which is not itemstack sensitive, and there is no longer any abstracted damage method like there used to be (damageVsEntity())

Tarig0 commented 10 years ago

That doesn't seem right how does sharpness or bane of the enthropods do more damage?

Eurymachus commented 10 years ago

its all calculated through entitylivingbase.attackTargetEntityWithCurrentItem. Here it keeps running score of damage using getEnchantmentModifierLiving, then calls, entity.attackEntityFrom. getAttributeModifiers is used for things like knockback and is applied onUpdate depending on equipped itemstack.

There is LivingHurtEvent, which I could implement but I think that would mean copy paste of existing MC code which seems counter productive. I'm sure there is a way to do this with the current setup, but we'll see.

Eurymachus commented 10 years ago

7df6a107dc3074d87300eaa931317b239c792b5a