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

Blacksmith debuffs weapons #41

Open
maffe03 opened this issue Jun 25, 2021 · 6 comments
Open

Blacksmith debuffs weapons #41

maffe03 opened this issue Jun 25, 2021 · 6 comments

Comments

@maffe03
Copy link

maffe03 commented Jun 25, 2021

When modifying generic.attack_damage of an item, as I have understood it through observation, it does not actually work as expected. For one, it resets generic.attack_speed to the default of a player, not the default for the item. It seems to do the same to the attack damage, applying the +0.5 damage to a player's default 2.0.
I don't know why it works like this, and honestly, I probably don't want to know.

@PlasmicDevil
Copy link

I have the same issue, swords and bows seem to be debuffed. Also, armor too. I'm basing it off of memory, I swear I used to take much less damage from things with my armor.

@DavidGodinho
Copy link

@PlasmicDevil are you using the Shulk origin? I did ran into an issue where the armor not only did not stack with the Shulk origin but made them take more damage when armored as opposed to being an unarmored human, basically giving them negative armor.

@PlasmicDevil
Copy link

@JellyCreeperOfficial I am not using shulk, no. I am a phantom in the world that I am playing on. By the way, if you can get access to creative, re-making the weapons and armor fixes the debuffed armor issue.

@apace100
Copy link
Owner

Did you use any other mods? I couldn't reproduce this on my end. This sounds like the attributes which are supposed to be "in addition" to the existing ones on the sword are actually replacing them. Don't know what could cause this except maybe an interference with another mod. :/

@maffe03
Copy link
Author

maffe03 commented Jul 18, 2021

Hmm... Nothing except the fabric api and lithium.

@Noaaan
Copy link

Noaaan commented Apr 28, 2023

Can confirm this issue, as it is related to an issue reported in Discord.
The attack damage attribute on the item seems to take priority and completely overrides the base attack damage. From testing this seems to happen in both 1.18.2 and 1.19+.

image

This is probably due to recalculating the attributes using Fabric API's stack-aware getAttributeModifiers method. Specifically my implementation copies and rebuilds the map with the new attack damage, and inserts it back using the vanilla UUID. This is to keep the green text that normally displays on the weapon, as otherwise it will display as the screenshots related to TieredZ #66

Link to code example: https://github.com/Noaaan/MythicMetals/blob/1.19.4/src/main/java/nourl/mythicmetals/item/tools/MidasGoldSword.java#L32-L58

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

5 participants