######Finds which array element of attribute modifiers contains the generic.attack_speed tag
tag @s add a
tag @s add b
tag @s add c
tag @s add d
tag @s add e
tag @s add f
tag @s add g
data modify entity @s[tag=!FoundASTag] Tags[0] set from entity @s[tag=!FoundASTag] Item.tag.AttributeModifiers[0].Name
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag0
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag
data modify entity @s[tag=!FoundASTag] Tags[0] set from entity @s[tag=!FoundASTag] Item.tag.AttributeModifiers[1].Name
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag1
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag
data modify entity @s[tag=!FoundASTag] Tags[0] set from entity @s[tag=!FoundASTag] Item.tag.AttributeModifiers[2].Name
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag2
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag
data modify entity @s[tag=!FoundASTag] Tags[0] set from entity @s[tag=!FoundASTag] Item.tag.AttributeModifiers[3].Name
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag3
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag
data modify entity @s[tag=!FoundASTag] Tags[0] set from entity @s[tag=!FoundASTag] Item.tag.AttributeModifiers[4].Name
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag4
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag
data modify entity @s[tag=!FoundASTag] Tags[0] set from entity @s[tag=!FoundASTag] Item.tag.AttributeModifiers[5].Name
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag5
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag
data modify entity @s[tag=!FoundASTag] Tags[0] set from entity @s[tag=!FoundASTag] Item.tag.AttributeModifiers[6].Name
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag6
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag
data modify entity @s[tag=!FoundASTag] Tags[0] set from entity @s[tag=!FoundASTag] Item.tag.AttributeModifiers[7].Name
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag7
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag
data modify entity @s[tag=!FoundASTag] Tags[0] set from entity @s[tag=!FoundASTag] Item.tag.AttributeModifiers[8].Name
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag8
tag @s[tag=!FoundASTag,tag=generic.attack_speed] add FoundASTag

data modify entity @s[tag=!FoundASTag] Item.tag.AttributeModifiers append value {AttributeName:"generic.attack_speed",Name:"generic.attack_speed",Amount:0,Operation:0,Slot:"mainhand",UUID:[I;6969,6969,6969,1183]}