Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getAttackDamage causes java.lang.IllegalArgumentException again #26

Open
LyquidQrystal opened this issue Jan 6, 2025 · 0 comments
Open

Comments

@LyquidQrystal
Copy link

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant