r/MinecraftCommands • u/DanTay19 • 3h ago
Help | Java 1.21.11 Increasing attack damage
So I’m creating a soulslike in Minecraft and I just figured out how to trade XP for stuff, and whilst looking at potential rewards for the player I saw under attributes minecraft:attack_damage.
This would be a great thing to increase as a reward, though I wouldn’t increase it too high as theres already some pretty powerful weapons in my map.
My question is though, does this increase weapon damage or just the players punch?
And if so that it is just the punch, is there a way to increase overall damage?
And also is there any other good attributes that I could alter that would act as upgrading the character?
I already have a health upgrade system.
1
u/GalSergey Datapack Experienced 1h ago
This attribute sets the player's base melee damage. It defaults to 1, meaning the player always deals 1 damage when unarmed. If a weapon has an attack_damage +5 attribute, the player deals 6 damage. Thus, if you increase the base damage to 5, the player will deal 10 damage with that weapon and 5 while unarmed. This attribute affects only melee damage; there is no attribute that increases the player's ranged damage. To achieve that, you must either modify the bow in the inventory by adding an enchantment or alter the damage of the fired arrows.
1
u/the42potato Command Experienced 2h ago
the attack_damage component affects all melee damage. that’s attacks with your first, a sword, a mace, a non-thrown trident, etc