# sword summons #
execute as @e[tag=iceupgrade1] run summon item -227 73 68 {Item:{id:"minecraft:diamond_sword",count:1b,tag:{display:{Name:'{"text":"Ice Infused Sword","color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}',Lore:['{"text":"+1 Attack Damage","color":"blue","italic":false}','{"text":"-2 Attack Speed","color":"red","italic":false}']},HideFlags:167,AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:8,Operation:0,UUID:[I;1567578481,2016365042,-1645968550,1180052521],Slot:"mainhand"},{AttributeName:"generic.attack_speed",Name:"generic.attack_speed",Amount:-2.9,Operation:0,UUID:[I;-172951901,-71088102,-1509431026,-810599256],Slot:"mainhand"}],icesword:1b,Unbreakable:1b,Enchantments:[{id:"minecraft:sweeping_edge",lvl:1s}]}}}
execute as @e[tag=iceupgrade2] run summon item -227 73 68 {Item:{id:"minecraft:diamond_sword",count:1b,tag:{display:{Name:'{"text":"Ice Reforged Sword","color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}',Lore:['{"text":"+1 Attack Damage","color":"blue","italic":false}','{"text":"-1 Attack Speed","color":"red","italic":false}']},HideFlags:167,AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:8,Operation:0,UUID:[I;1567578481,2016365042,-1645968550,1180052521],Slot:"mainhand"},{AttributeName:"generic.attack_speed",Name:"generic.attack_speed",Amount:-2.7,Operation:0,UUID:[I;-172951901,-71088102,-1509431026,-810599256],Slot:"mainhand"}],icesword2:1b,Unbreakable:1b,Enchantments:[{id:"minecraft:sweeping_edge",lvl:2s}]}}}
execute as @e[tag=iceupgrade3] run summon item -227 73 68 {Item:{id:"minecraft:diamond_sword",count:1b,tag:{display:{Name:'{"text":"Ice Augmented Sword","color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}',Lore:['{"text":"+2 Attack Damage","color":"blue","italic":false}','{"text":"-1 Attack Speed","color":"red","italic":false}']},HideFlags:167,AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:9,Operation:0,UUID:[I;1567578481,2016365042,-1645968550,1180052521],Slot:"mainhand"},{AttributeName:"generic.attack_speed",Name:"generic.attack_speed",Amount:-2.7,Operation:0,UUID:[I;-172951901,-71088102,-1509431026,-810599256],Slot:"mainhand"}],icesword3:1b,Unbreakable:1b,Enchantments:[{id:"minecraft:sweeping_edge",lvl:3s}]}}}
execute as @e[tag=iceupgrade4] run summon item -227 73 68 {Item:{id:"minecraft:diamond_sword",count:1b,tag:{display:{Name:'{"text":"Ice Reinforced Sword","color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}',Lore:['{"text":"+2 Attack Damage","color":"blue","italic":false}']},HideFlags:167,AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:10,Operation:0,UUID:[I;1567578481,2016365042,-1645968550,1180052521],Slot:"mainhand"},{AttributeName:"generic.attack_speed",Name:"generic.attack_speed",Amount:-2.5,Operation:0,UUID:[I;-172951901,-71088102,-1509431026,-810599256],Slot:"mainhand"}],icesword4:1b,Unbreakable:1b,Enchantments:[{id:"minecraft:sweeping_edge",lvl:4s}]}}}

execute as @e[tag=slimeupgrade1] run summon item -227 73 68 {Item:{id:"minecraft:diamond_sword",count:1b,tag:{display:{Name:'{"text":"Slime Infused Sword","color":"green","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}',Lore:['{"text":"+1 Movement Speed","color":"blue","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}','{"text":"+1 Jump Boost","color":"blue","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}','{"text":"-2 Defense","color":"red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}']},HideFlags:167,slimesword:1b,Unbreakable:1b,Enchantments:[{id:"minecraft:knockback",lvl:1s}],AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:7,Operation:0,UUID:[I;-1819888582,-658423485,-1871864955,1335798327],Slot:"mainhand"},{AttributeName:"generic.armor",Name:"generic.armor",Amount:-4,Operation:0,UUID:[I;-1418282284,-1645851679,-1413699148,-2095565845],Slot:"mainhand"},{AttributeName:"generic.attack_speed",Name:"generic.attack_speed",Amount:-2.5,Operation:0,UUID:[I;-1872945890,-588558812,-1718345542,-1969188031],Slot:"mainhand"}]}}}
execute as @e[tag=slimeupgrade2] run summon item -227 73 68 {Item:{id:"minecraft:diamond_sword",count:1b,tag:{display:{Name:'{"text":"Slime Reforged Sword","color":"green","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}',Lore:['{"text":"+1 Movement Speed","color":"blue","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}','{"text":"+1 Jump Boost","color":"blue","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}','{"text":"-1 Defense","color":"red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}']},HideFlags:167,slimesword2:1b,Unbreakable:1b,Enchantments:[{id:"minecraft:knockback",lvl:1s}],AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:7,Operation:0,UUID:[I;-1819888582,-658423485,-1871864955,1335798327],Slot:"mainhand"},{AttributeName:"generic.armor",Name:"generic.armor",Amount:-2,Operation:0,UUID:[I;-1418282284,-1645851679,-1413699148,-2095565845],Slot:"mainhand"},{AttributeName:"generic.attack_speed",Name:"generic.attack_speed",Amount:-2.5,Operation:0,UUID:[I;-1872945890,-588558812,-1718345542,-1969188031],Slot:"mainhand"}]}}}
execute as @e[tag=slimeupgrade3] run summon item -227 73 68 {Item:{id:"minecraft:diamond_sword",count:1b,tag:{display:{Name:'{"text":"Slime Augmented Sword","color":"green","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}',Lore:['{"text":"+2 Movement Speed","color":"blue","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}','{"text":"+2 Jump Boost","color":"blue","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}','{"text":"-1 Defense","color":"red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}']},HideFlags:167,slimesword3:1b,Unbreakable:1b,Enchantments:[{id:"minecraft:knockback",lvl:2s}],AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:7,Operation:0,UUID:[I;-1819888582,-658423485,-1871864955,1335798327],Slot:"mainhand"},{AttributeName:"generic.armor",Name:"generic.armor",Amount:-2,Operation:0,UUID:[I;-1418282284,-1645851679,-1413699148,-2095565845],Slot:"mainhand"},{AttributeName:"generic.attack_speed",Name:"generic.attack_speed",Amount:-2.5,Operation:0,UUID:[I;-1872945890,-588558812,-1718345542,-1969188031],Slot:"mainhand"}]}}}
execute as @e[tag=slimeupgrade4] run summon item -227 73 68 {Item:{id:"minecraft:diamond_sword",count:1b,tag:{display:{Name:'{"text":"Slime Reinforced Sword","color":"green","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}',Lore:['{"text":"+2 Movement Speed","color":"blue","italic":false}','{"text":"+2 Jump Boost","color":"blue","italic":false}']},HideFlags:167,slimesword4:1b,Unbreakable:1b,Enchantments:[{id:"minecraft:knockback",lvl:2s}],AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:7,Operation:0,UUID:[I;-195748283,-1863103144,-1175556509,1277623777],Slot:"mainhand"},{AttributeName:"generic.armor",Name:"generic.armor",Amount:0,Operation:0,UUID:[I;-2074165008,660948966,-1822762200,-524664549],Slot:"mainhand"},{AttributeName:"generic.attack_speed",Name:"generic.attack_speed",Amount:-2.5,Operation:0,UUID:[I;-2144717951,1730628700,-1480922269,-772514785],Slot:"mainhand"}]}}}

execute as @e[tag=magmaupgrade1] run summon item -227 73 68 {Item:{id:"minecraft:diamond_sword",count:1b,tag:{display:{Name:'{"text":"Magma Infused Sword","color":"#FC6812","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}',Lore:['{"text":"+1 Attack Speed","color":"blue","italic":false}','{"text":"-2 Attack Damage","color":"red","italic":false}']},HideFlags:167,magmasword:1b,Unbreakable:1b,Enchantments:[{id:"minecraft:fire_aspect",lvl:1s}],AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:5,Operation:0,UUID:[I;-1741135019,1203848384,-1454821966,-1249825957],Slot:"mainhand"},{AttributeName:"generic.attack_speed",Name:"generic.attack_speed",Amount:-2.3,Operation:0,UUID:[I;-328918013,-658355441,-1559592080,694147742],Slot:"mainhand"}]}}}
execute as @e[tag=magmaupgrade2] run summon item -227 73 68 {Item:{id:"minecraft:diamond_sword",count:1b,tag:{display:{Name:'{"text":"Magma Reforged Sword","color":"#FC6812","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}',Lore:['{"text":"+1 Attack Speed","color":"blue","italic":false}','{"text":"-1 Attack Damage","color":"red","italic":false}']},HideFlags:167,magmasword2:1b,Unbreakable:1b,Enchantments:[{id:"minecraft:fire_aspect",lvl:1s}],AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:6,Operation:0,UUID:[I;-1741135019,1203848384,-1454821966,-1249825957],Slot:"mainhand"},{AttributeName:"generic.attack_speed",Name:"generic.attack_speed",Amount:-2.3,Operation:0,UUID:[I;-328918013,-658355441,-1559592080,694147742],Slot:"mainhand"}]}}}
execute as @e[tag=magmaupgrade3] run summon item -227 73 68 {Item:{id:"minecraft:diamond_sword",count:1b,tag:{display:{Name:'{"text":"Magma Augmented Sword","color":"#FC6812","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}',Lore:['{"text":"+2 Attack Speed","color":"blue","italic":false}','{"text":"-1 Attack Damage","color":"red","italic":false}']},HideFlags:167,magmasword3:1b,Unbreakable:1b,Enchantments:[{id:"minecraft:fire_aspect",lvl:2s}],AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:6,Operation:0,UUID:[I;-1741135019,1203848384,-1454821966,-1249825957],Slot:"mainhand"},{AttributeName:"generic.attack_speed",Name:"generic.attack_speed",Amount:-2.1,Operation:0,UUID:[I;-328918013,-658355441,-1559592080,694147742],Slot:"mainhand"}]}}}
execute as @e[tag=magmaupgrade4] run summon item -227 73 68 {Item:{id:"minecraft:diamond_sword",count:1b,tag:{display:{Name:'{"text":"Magma Reinforced Sword","color":"#FC6812","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}',Lore:['{"text":"+2 Attack Speed","color":"blue","italic":false}']},HideFlags:167,magmasword4:1b,Unbreakable:1b,Enchantments:[{id:"minecraft:fire_aspect",lvl:2s}],AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:7,Operation:0,UUID:[I;-1741135019,1203848384,-1454821966,-1249825957],Slot:"mainhand"},{AttributeName:"generic.attack_speed",Name:"generic.attack_speed",Amount:-2.1,Operation:0,UUID:[I;-328918013,-658355441,-1559592080,694147742],Slot:"mainhand"}]}}}

execute as @e[tag=waterupgrade1] run summon item -227 73 68 {Item:{id:"minecraft:diamond_sword",count:1b,tag:{display:{Name:'{"text":"Water Infused Sword","color":"blue","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}',Lore:['{"text":"+1 Defense","color":"blue","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}','{"text":"-1 Movement Speed","color":"red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}','{"text":"-1 Attack Speed","color":"red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}']},HideFlags:167,watersword:1b,Unbreakable:1b,Enchantments:[{id:"minecraft:smite",lvl:1s}],AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:7,Operation:0,UUID:[I;-409894880,1669352472,-1568436573,1729181964],Slot:"mainhand"},{AttributeName:"generic.armor",Name:"generic.armor",Amount:4,Operation:0,UUID:[I;-1183598071,866404616,-1992519151,-1715163840],Slot:"mainhand"},{AttributeName:"generic.attack_speed",Name:"generic.attack_speed",Amount:-2.7,Operation:0,UUID:[I;375934419,1991330913,-1731754079,1945322600],Slot:"mainhand"}]}}}
execute as @e[tag=waterupgrade2] run summon item -227 73 68 {Item:{id:"minecraft:diamond_sword",count:1b,tag:{display:{Name:'{"text":"Water Reforged Sword","color":"blue","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}',Lore:['{"text":"+1 Defense","color":"blue","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}','{"text":"-1 Attack Speed","color":"red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}']},HideFlags:167,watersword2:1b,Unbreakable:1b,Enchantments:[{id:"minecraft:smite",lvl:1s}],AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:7,Operation:0,UUID:[I;-409894880,1669352472,-1568436573,1729181964],Slot:"mainhand"},{AttributeName:"generic.armor",Name:"generic.armor",Amount:4,Operation:0,UUID:[I;-1183598071,866404616,-1992519151,-1715163840],Slot:"mainhand"},{AttributeName:"generic.attack_speed",Name:"generic.attack_speed",Amount:-2.7,Operation:0,UUID:[I;375934419,1991330913,-1731754079,1945322600],Slot:"mainhand"}]}}}
execute as @e[tag=waterupgrade3] run summon item -227 73 68 {Item:{id:"minecraft:diamond_sword",count:1b,tag:{display:{Name:'{"text":"Water Augmented Sword","color":"blue","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}',Lore:['{"text":"+2 Defense","color":"blue","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}','{"text":"-1 Attack Speed","color":"red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}']},HideFlags:167,watersword3:1b,Unbreakable:1b,Enchantments:[{id:"minecraft:smite",lvl:2s}],AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:7,Operation:0,UUID:[I;-409894880,1669352472,-1568436573,1729181964],Slot:"mainhand"},{AttributeName:"generic.armor",Name:"generic.armor",Amount:6,Operation:0,UUID:[I;-1183598071,866404616,-1992519151,-1715163840],Slot:"mainhand"},{AttributeName:"generic.attack_speed",Name:"generic.attack_speed",Amount:-2.7,Operation:0,UUID:[I;375934419,1991330913,-1731754079,1945322600],Slot:"mainhand"}]}}}
execute as @e[tag=waterupgrade4] run summon item -227 73 68 {Item:{id:"minecraft:diamond_sword",count:1b,tag:{display:{Name:'{"text":"Water Reinforced Sword","color":"blue","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}',Lore:['{"text":"+2 Defense","color":"blue","italic":false}']},HideFlags:167,watersword4:1b,Unbreakable:1b,Enchantments:[{id:"minecraft:smite",lvl:2s}],AttributeModifiers:[{AttributeName:"generic.armor",Name:"generic.armor",Amount:6,Operation:0,UUID:[I;-2074165008,660948966,-1822762200,-524664549],Slot:"mainhand"},{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:7,Operation:0,UUID:[I;-510251932,2052800631,-1360277058,-61806724]},{AttributeName:"generic.attack_speed",Name:"generic.attack_speed",Amount:-2.5,Operation:0,UUID:[I;-1748986142,185421465,-1400606773,793176616]}]}}}

# tag removes #
tag @e[type=minecraft:villager,limit=1,tag=Path1] remove iceupgrade1
tag @e[type=minecraft:villager,limit=1,tag=Path1] remove iceupgrade2
tag @e[type=minecraft:villager,limit=1,tag=Path1] remove iceupgrade3
tag @e[type=minecraft:villager,limit=1,tag=Path1] remove iceupgrade4
tag @e[type=minecraft:villager,limit=1,tag=Path1] remove slimeupgrade1
tag @e[type=minecraft:villager,limit=1,tag=Path1] remove slimeupgrade2
tag @e[type=minecraft:villager,limit=1,tag=Path1] remove slimeupgrade3
tag @e[type=minecraft:villager,limit=1,tag=Path1] remove slimeupgrade4
tag @e[type=minecraft:villager,limit=1,tag=Path1] remove magmaupgrade1
tag @e[type=minecraft:villager,limit=1,tag=Path1] remove magmaupgrade2
tag @e[type=minecraft:villager,limit=1,tag=Path1] remove magmaupgrade3
tag @e[type=minecraft:villager,limit=1,tag=Path1] remove magmaupgrade4
tag @e[type=minecraft:villager,limit=1,tag=Path1] remove waterupgrade1
tag @e[type=minecraft:villager,limit=1,tag=Path1] remove waterupgrade2
tag @e[type=minecraft:villager,limit=1,tag=Path1] remove waterupgrade3
tag @e[type=minecraft:villager,limit=1,tag=Path1] remove waterupgrade4

# notifies #
execute positioned -227 72 68 as @a run playsound minecraft:entity.firework_rocket.twinkle master @s ~ ~1 ~ 50 1.2
tellraw @a {"text":"----------------------------","color":"dark_gray","bold":true}
tellraw @a ""
tellraw @a {"text":"        Upgrade Concluded","color":"green","bold":true}
tellraw @a {"text":"Your sword is waiting at the forge!","color":"gray","bold":true}
tellraw @a ""
tellraw @a {"text":"----------------------------","color":"dark_gray","bold":true}

# resets #
fill -235 35 144 -235 35 139 air
tp @e[tag=Path1,type=villager,limit=1] -230.5 72.00 59.5 166.5 35
setblock -237 35 129 air
setblock -236 35 129 air
setblock -235 35 129 minecraft:redstone_block
setblock -237 35 146 air
