execute at @s positioned ~ 254 ~ run data modify entity @s Item set from block ~ 254 ~ Items[{Slot:0b}]

data merge entity @s {Tags:[]}
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=!FoundUnbreakTag] Tags[0] set from entity @s[tag=!FoundUnbreakTag] Item.tag.Enchantments[0].id
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag0
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag
data modify entity @s[tag=!FoundUnbreakTag] Tags[0] set from entity @s[tag=!FoundUnbreakTag] Item.tag.Enchantments[1].id
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag1
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag
data modify entity @s[tag=!FoundUnbreakTag] Tags[0] set from entity @s[tag=!FoundUnbreakTag] Item.tag.Enchantments[2].id
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag2
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag
data modify entity @s[tag=!FoundUnbreakTag] Tags[0] set from entity @s[tag=!FoundUnbreakTag] Item.tag.Enchantments[3].id
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag3
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag
data modify entity @s[tag=!FoundUnbreakTag] Tags[0] set from entity @s[tag=!FoundUnbreakTag] Item.tag.Enchantments[4].id
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag4
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag
data modify entity @s[tag=!FoundUnbreakTag] Tags[0] set from entity @s[tag=!FoundUnbreakTag] Item.tag.Enchantments[5].id
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag5
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag
data modify entity @s[tag=!FoundUnbreakTag] Tags[0] set from entity @s[tag=!FoundUnbreakTag] Item.tag.Enchantments[6].id
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag6
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag
data modify entity @s[tag=!FoundUnbreakTag] Tags[0] set from entity @s[tag=!FoundUnbreakTag] Item.tag.Enchantments[7].id
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag7
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag
data modify entity @s[tag=!FoundUnbreakTag] Tags[0] set from entity @s[tag=!FoundUnbreakTag] Item.tag.Enchantments[8].id
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag8
tag @s[tag=!FoundUnbreakTag,nbt={Tags:["minecraft:unbreaking"]}] add FoundUnbreakTag

execute as @s[tag=FoundUnbreakTag0] run data modify entity @s Item.tag.Enchantments[0].lvl set value 9
execute as @s[tag=FoundUnbreakTag1] run data modify entity @s Item.tag.Enchantments[1].lvl set value 9
execute as @s[tag=FoundUnbreakTag2] run data modify entity @s Item.tag.Enchantments[2].lvl set value 9
execute as @s[tag=FoundUnbreakTag3] run data modify entity @s Item.tag.Enchantments[3].lvl set value 9
execute as @s[tag=FoundUnbreakTag4] run data modify entity @s Item.tag.Enchantments[4].lvl set value 9
execute as @s[tag=FoundUnbreakTag5] run data modify entity @s Item.tag.Enchantments[5].lvl set value 9
execute as @s[tag=FoundUnbreakTag6] run data modify entity @s Item.tag.Enchantments[6].lvl set value 9
execute as @s[tag=FoundUnbreakTag7] run data modify entity @s Item.tag.Enchantments[7].lvl set value 9
execute as @s[tag=FoundUnbreakTag8] run data modify entity @s Item.tag.Enchantments[8].lvl set value 9

execute at @s[tag=!FoundUnbreakTag] run summon item ~ ~ ~ {Tags:["UnbreakNine"],PickupDelay:666,Item:{id:"minecraft:iron_axe",Count:1b,tag:{Enchantments:[{id:"minecraft:unbreaking",lvl:9s}]}}}
execute as @s[tag=!FoundUnbreakTag] run data modify entity @s Item.tag.Enchantments append from entity @e[type=item,tag=UnbreakNine,limit=1,distance=..3] Item.tag.Enchantments[0]
execute as @s[tag=!FoundUnbreakTag] run kill @e[type=item,tag=UnbreakNine,limit=1,distance=..3]

execute at @s run data modify entity @s Item.tag merge value {gotunbreakingnine:1b}