tag @s remove EnchantableMH

#data get entity @e[type=item,limit=1,sort=nearest] Item.tag.Enchantments[0].id
enchant @s[nbt=!{SelectedItem:{tag:{splintersaxe:1b}}}] minecraft:unbreaking 1
execute as @s[nbt={SelectedItem:{tag:{Enchantments:[{id:"minecraft:unbreaking"}]}}}] run execute as @s[nbt=!{SelectedItem:{tag:{gotunbreakingnine:1b}}}] run execute as @s[nbt=!{SelectedItem:{tag:{splintersaxe:1b}}}] run tag @s add EnchantableMH
#splintersaxe:1b

#scoreboard players add @a[tag=K,nbt={SelectedItem:{id:"minecraft:rabbit_foot",tag:{display:{Lore:["\"Gives +1 luck when held in your hand.\""]}}}}] KyuLuck 1
#scoreboard players add @a[tag=K,nbt={Inventory:[{tag:{kyudubloon:1b}}]}] KyuLuck 1

execute at @s[tag=EnchantableMH] positioned ~ 254 ~ run setblock ~ ~ ~ minecraft:chest destroy
execute at @s[tag=EnchantableMH] positioned ~ 254 ~ run data modify block ~ ~ ~ Items append from entity @s SelectedItem
execute at @s[tag=EnchantableMH] positioned ~ 254 ~ run summon minecraft:item ~ ~ ~ {Tags:["UnbreakMe"],Item:{id:"minecraft:structure_void",Count:55b},PickupDelay:2,Age:1999s}
execute at @s[tag=EnchantableMH] positioned ~ 254 ~ run execute as @e[distance=..11,type=item,limit=1,sort=nearest,tag=UnbreakMe] run function zzzzdonotuse:spell/offhandactivate/unbreakingninetagcheck
execute at @s[tag=EnchantableMH] run fill ~ 254 ~ ~ 254 ~ air
execute as @s[tag=EnchantableMH] run item replace entity @s weapon.mainhand with air
execute as @s[tag=EnchantableMH] run execute at @s positioned ~ 254 ~ run tp @e[distance=..8,sort=nearest,limit=1,nbt={Item:{tag:{gotunbreakingnine:1b}}}] @s
tellraw @s[tag=EnchantableMH] ["",{"text":"Your item has been enchanted with Unbreaking IX, consuming your scroll in the process.","color":"aqua","italic":true}]
clear @s[tag=EnchantableMH] minecraft:globe_banner_pattern{unbreakingnine:1b} 1
tag @s remove EnchantableMH