I've been experimenting with attribute modifiers on items. What's interesting is that each attribute modifier requires a UUID. So I've provided one myself by simply punching in random numbers on my keyboard number pad.
I know that in NBT, the UUID is stored in an Integer Array, which is formatted like this:
[I;1,2,3,4,5,6]
And here are two of my completed commands (this is as minimal as it gets):
give @p diamond_sword{AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:1,Operation:0,UUID:[I;385638563,384738473,018492747,395785936]}]} 1
give @p diamond_sword{AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:1,Operation:0,UUID:[I;828748274,736284721,276385632,174612674]}]} 1
If you don't want to get that complicated, I've stripped it down to the bare minimums, with these commands using user-defined tags (they don't do anything but make it look cleaner:)
give @p dirt{MyIntArray:[I;123,345,567,789]}
give @p dirt{MyIntArray:[I;123,456,789,012]}
In both of the above examples, one of them causes an error. The other does not. But all I did was enter different numbers. What could be the problem?