I want to use the attribute command to make a specific netherite sword a lot of damage, but when I enter the command, there is an error, the error is: attribute attack damage for entity <player name> has no modifier minecraft:netherite_sword.
You could also replace any Netherite sword they are holding with this command and some additional logic:
item replace entity @s weapon.mainhand with minecraft:netherite_sword[minecraft:attribute_modifiers=[{id:"attack_damage",type:"generic.attack_damage",amount:5,operation:"add_value",slot:"mainhand"}]]
If you don't want to give custom items, you could use the following commands:
# Command 1, repeating
/execute as @a if data entity @s SelectedItem{id:"minecraft:netherite_sword"} run attribute @s minecraft:generic.attack_damage base set 5
# Command 2, chain
/execute as @a unless data entity @s SelectedItem{id:"minecraft:netherite_sword"} run attribute @s minecraft:generic.attack_damage base set 1
This will increase the damage done by 5 times (or whatever you want) while holding a Netherite sword.
I want to use the attribute command to make a specific netherite sword a lot of damage, but when I enter the command, there is an error, the error is: attribute attack damage for entity <player name> has no modifier minecraft:netherite_sword.
Hello,
If you want a specific item to deal extra damage, I would recommend just using a custom item instead:
This Netherite sword will deal 5 extra damage.
You could also replace any Netherite sword they are holding with this command and some additional logic:
If you don't want to give custom items, you could use the following commands:
This will increase the damage done by 5 times (or whatever you want) while holding a Netherite sword.
Hope this helps!
-TechnoBro03
That works perfectly, thank you for your reply. Have a good day!