Topic category: Help with Minecraft modding (Java Edition)
So I created a weapon that levels up its damage based on the number of kills you get. However, no matter what I try, it doesn't seem to work. Here's what I've tried so far:
Adding and Removing Damage Attributes [Attribute plugin]:
I tried adding generic.attack_damage to the weapon and then removing it before re-adding a stronger one with the same UUID.
Example:
- Level 1: +1 generic.attack_damage
- Level 2: +2 generic.attack_damage
However, it either adds the strongest one or combines all the previous ones, even though I remove the previous attribute first.
Using Triggers:
I used the trigger "Before entity is Hurt" to check if the item causing damage is the weapon. Inside that check, I verify the weapon's level and then add "Deal [ ] damage to [Event/Target entity] from source: [ ]". This approach didn't work either.
Problem:
I want to add damage to a weapon dynamically, similar to creating a new weapon with different damage values for each level, but without actually creating multiple weapons. For example, instead of creating 10 different weapons for 10 levels, I want a single weapon that handles all levels.
Working Part:
The levelling system itself works because it adds enchantments correctly at each level (e.g., sharpness 1 at level 1 and up to sharpness 10 at level 10).
Questions:
Are there any bugs with the "Deal Damage" function?
Is it possible to directly change a weapon's damage attribute dynamically without creating a new weapon each time?
do you use attributes plugin for it?
Yes, i have used it and i am still using it but it doesn't want to work properly
use variables to count kills then use variable for modifier number
item's nbt variable*
also use deprecated procedure blocks for items from attribute plugin
I have tried all of that already and it didnt work. i will post it here if i find a fix or idk what else