![Better Combat [Fabric & Forge]](https://media.forgecdn.net/avatars/thumbnails/566/413/256/256/637925434672465483.png)
Divide by zero crash with certain Weapon Attributes
Closed this issue ยท 3 comments
Minecraft version - 1.21.1
Mod loader - Fabric
Mod version - 2.1.3
I am using the latest version available - Yes!
Describe the bug
Some weapon attributes containers seem to cause a crash, instead of being sanitized/marked as invalid.
An example is Simply Swords' Soulrender:
https://github.com/Sweenus/SimplySwords/blob/c81638c2fe0b3d9effe90352eeb5536ba118f20b/common/src/main/resources/data/simplyswords/weapon_attributes/soulrender.json
To Reproduce
Steps to reproduce the behavior:
- Install Simply Swords and Better Combat
- Equip a Soulrender
- Equip an item (with no weapon attributes) in your offhand
- Crash
Crash report
https://mclo.gs/lZHow7h
Additional Info
The divide by zero seems to be referring to this modulo:
Changing the last two NO_OFFHAND_ITEM
attacks in the example json to NOT_DUAL_WIELDING
fixes the crash, so maybe this is caused by the weapon having no valid attacks available? In that case, I still think it should be sanitized/fall back/have no weapon attributes.
I am unable to reproduce the issue.
It would help a lot if you could give feedback, whether this commit fixed the issue.
Posted on built Jar also Discord pre-release channel