Visuality: Reforged

Visuality: Reforged

18M Downloads

getAttackDamage causes java.lang.IllegalArgumentException again

LyquidQrystal opened this issue ยท 1 comments

commented

Hi, Marble. I received an issue yesterday:LyquidQrystal/fightorflight#22
It says that getAttackDamage causes java.lang.IllegalArgumentException: Can't find attribute minecraft:generic.attack_damage
I use mixin to add melee/range goal to the PokemonEntity(an entity that doesn't have attack_damage attribute) to hurt entity and the damage is set by a function because the damage might be dynamic, which means there is no attack_damage attribute for the entity. I tried to add it but I failed. I want to know if it's possible to ask you to add some code to check if the attribute exist. I noticed that someone mentioned this and you fixed it before, but you refactored it away. Can you add it back? Thanks!

return attacker.getMainHandItem().getAttributeModifiers().compute(attacker.getAttributeBaseValue(Attributes.ATTACK_DAMAGE),EquipmentSlot.MAINHAND);

commented

Fixed.