I'm doing a RPG in minecraft with some friends but we don't know how to modify the sword damage with commands, we have already tried this command…
/give @p minecraft:diamond_sword{AttributeModifiers:[{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:10,Operation:0,UUIDLeast:724099,UUIDMost:439684,Slot:"mainhand"}],Unbreakable:1}
…but it didn't work.
If possible, show us how to do it in 1.16.1 .
Best Answer
First of all, in 1.16, the attribute modifiers have been renamed. Therefore,
generic.attackDamage
is nowgeneric.attack_damage
.Then, you must get the UUID correct. The UUID is now stored as an
TAG_Int_Array
instead of twoTAG_Long
s. So instead of:Therefore, here is the replacement for your UUID:
But there's another quirk about the system. Apparently,
TAG_String
s don't need to be quote-surrounded if they don't contain spaces and special characters. This means you can make a string tag like this:But this also means that any items that aren't valid numbers are treated like strings, and numbers with prefixed zeros are considered invalid and are treated as strings. So
99
is aTAG_Integer
, but099
is aTAG_String
, even if there are no quotes around it.Fixed command: