#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#
#    This function has been created by Skilendarz Group.
#             https://skilendarz.com
#
#      GIVE MAP MAKERS THE CREDIT THEY DESERVE!
#             COPYING IS PROHIBITED!
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

#Slots
scoreboard players add @s wineffect_select 0
scoreboard players add @s wineffect_preview 0
execute unless score @s wineffect_select matches 0 run item replace entity @s enderchest.0 with minecraft:barrier{Clear:1,display:{Name:'{"translate":"win_effect.none","color":"green","bold":true,"italic":false}',Lore:['{"text":" "}','{"translate":"win_effect.equip","color":"yellow","bold":false,"italic":false}']},HideFlags:4}
execute unless score @s wineffect_select matches 1 if entity @s[advancements={f:victory_royal=true}] run item replace entity @s enderchest.1 with minecraft:lime_dye{CustomModelData:71,Clear:1,display:{Name:'{"translate":"win_effect.aura","color":"green","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.victory_royal","color":"gold"}]','{"text":" "}','{"translate":"win_effect.equip","color":"yellow","bold":false,"italic":false}']},HideFlags:4}
execute unless score @s wineffect_select matches 2 if entity @s[advancements={f:halloween_tragedy=true}] run item replace entity @s enderchest.2 with minecraft:fire_charge{Clear:1,display:{Name:'{"translate":"win_effect.meteor","color":"green","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.halloween_tragedy","color":"gold"}]','{"text":" "}','{"translate":"win_effect.equip","color":"yellow","bold":false,"italic":false}']},HideFlags:4}
execute unless score @s wineffect_select matches 3 if entity @s[advancements={f:plot_armor=true}] run item replace entity @s enderchest.9 with minecraft:lime_dye{CustomModelData:52,Clear:1,display:{Name:'{"translate":"win_effect.dab","color":"green","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.plot_armor","color":"gold"}]','{"text":" "}','{"translate":"win_effect.equip","color":"yellow","bold":false,"italic":false}']},HideFlags:4}
execute unless score @s wineffect_select matches 4 if entity @s[advancements={f:lightspeed_traveler=true}] run item replace entity @s enderchest.10 with minecraft:lime_dye{CustomModelData:55,Clear:1,display:{Name:'{"translate":"win_effect.pumpkin","color":"green","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.lightspeed_traveler","color":"gold"}]','{"text":" "}','{"translate":"win_effect.equip","color":"yellow","bold":false,"italic":false}']},HideFlags:4}
execute unless score @s wineffect_select matches 5 if entity @s[advancements={f:sniper=true}] run item replace entity @s enderchest.11 with minecraft:lime_dye{CustomModelData:72,Clear:1,display:{Name:'{"translate":"win_effect.ghost","color":"green","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.sniper","color":"gold"}]','{"text":" "}','{"translate":"win_effect.equip","color":"yellow","bold":false,"italic":false}']},HideFlags:4}
execute unless score @s wineffect_select matches 6 if entity @s[advancements={f:veteran=true}] run item replace entity @s enderchest.18 with minecraft:amethyst_shard{Clear:1,display:{Name:'{"translate":"win_effect.witch","color":"green","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.veteran","color":"gold"}]','{"text":" "}','{"translate":"win_effect.equip","color":"yellow","bold":false,"italic":false}']},HideFlags:4}
execute unless score @s wineffect_select matches 7 if entity @s[advancements={f:professional_robbery=true}] run item replace entity @s enderchest.19 with minecraft:gold_ingot{Clear:1,display:{Name:'{"translate":"win_effect.gold","color":"green","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.professional_robbery","color":"gold"}]','{"text":" "}','{"translate":"win_effect.equip","color":"yellow","bold":false,"italic":false}']},HideFlags:4}
execute unless score @s wineffect_select matches 8 if entity @s[advancements={f:warrior=true}] run item replace entity @s enderchest.20 with minecraft:firework_rocket{Clear:1,display:{Name:'{"translate":"win_effect.tnt","color":"green","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.warrior","color":"gold"}]','{"text":" "}','{"translate":"win_effect.equip","color":"yellow","bold":false,"italic":false}']},HideFlags:4}

execute if entity @s[advancements={f:victory_royal=false}] run item replace entity @s enderchest.1 with minecraft:red_dye{CustomModelData:71,Clear:1,display:{Name:'{"translate":"win_effect.aura","color":"red","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.victory_royal","color":"gold"}]','{"text":" "}','{"translate":"win_effect.preview","color":"yellow","bold":false,"italic":false}']},HideFlags:4}
execute if entity @s[advancements={f:halloween_tragedy=false}] run item replace entity @s enderchest.2 with minecraft:red_dye{Clear:1,display:{Name:'{"translate":"win_effect.meteor","color":"red","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.halloween_tragedy","color":"gold"}]','{"text":" "}','{"translate":"win_effect.preview","color":"yellow","bold":false,"italic":false}']},HideFlags:4}
execute if entity @s[advancements={f:plot_armor=false}] run item replace entity @s enderchest.9 with minecraft:red_dye{Clear:1,display:{Name:'{"translate":"win_effect.dab","color":"red","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.plot_armor","color":"gold"}]','{"text":" "}','{"translate":"win_effect.preview","color":"yellow","bold":false,"italic":false}']},HideFlags:4}
execute if entity @s[advancements={f:lightspeed_traveler=false}] run item replace entity @s enderchest.10 with minecraft:red_dye{Clear:1,display:{Name:'{"translate":"win_effect.pumpkin","color":"red","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.lightspeed_traveler","color":"gold"}]','{"text":" "}','{"translate":"win_effect.preview","color":"yellow","bold":false,"italic":false}']},HideFlags:4}
execute if entity @s[advancements={f:sniper=false}] run item replace entity @s enderchest.11 with minecraft:red_dye{Clear:1,display:{Name:'{"translate":"win_effect.ghost","color":"red","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.sniper","color":"gold"}]','{"text":" "}','{"translate":"win_effect.preview","color":"yellow","bold":false,"italic":false}']},HideFlags:4}
execute if entity @s[advancements={f:veteran=false}] run item replace entity @s enderchest.18 with minecraft:red_dye{Clear:1,display:{Name:'{"translate":"win_effect.witch","color":"red","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.veteran","color":"gold"}]','{"text":" "}','{"translate":"win_effect.preview","color":"yellow","bold":false,"italic":false}']},HideFlags:4}
execute if entity @s[advancements={f:professional_robbery=false}] run item replace entity @s enderchest.19 with minecraft:red_dye{Clear:1,display:{Name:'{"translate":"win_effect.gold","color":"red","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.professional_robbery","color":"gold"}]','{"text":" "}','{"translate":"win_effect.preview","color":"yellow","bold":false,"italic":false}']},HideFlags:4}
execute if entity @s[advancements={f:warrior=false}] run item replace entity @s enderchest.20 with minecraft:red_dye{Clear:1,display:{Name:'{"translate":"win_effect.tnt","color":"red","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.warrior","color":"gold"}]','{"text":" "}','{"translate":"win_effect.preview","color":"yellow","bold":false,"italic":false}']},HideFlags:4}

execute if score @s wineffect_select matches 0 run item replace entity @s enderchest.0 with minecraft:barrier{Clear:1,display:{Name:'{"translate":"win_effect.none","color":"green","bold":true,"italic":false}',Lore:['{"text":" "}','{"translate":"win_effect.equipped","color":"green","bold":false,"italic":false}']},HideFlags:4}
execute if score @s wineffect_select matches 1 run item replace entity @s enderchest.1 with minecraft:lime_dye{CustomModelData:71,Clear:1,display:{Name:'{"translate":"win_effect.aura","color":"green","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.victory_royal","color":"gold"}]','{"text":" "}','{"translate":"win_effect.equipped","color":"green","bold":false,"italic":false}']},HideFlags:4}
execute if score @s wineffect_select matches 2 run item replace entity @s enderchest.2 with minecraft:fire_charge{Clear:1,display:{Name:'{"translate":"win_effect.meteor","color":"green","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.halloween_tragedy","color":"gold"}]','{"text":" "}','{"translate":"win_effect.equipped","color":"green","bold":false,"italic":false}']},HideFlags:4}
execute if score @s wineffect_select matches 3 run item replace entity @s enderchest.9 with minecraft:lime_dye{CustomModelData:52,Clear:1,display:{Name:'{"translate":"win_effect.dab","color":"green","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.plot_armor","color":"gold"}]','{"text":" "}','{"translate":"win_effect.equipped","color":"green","bold":false,"italic":false}']},HideFlags:4}
execute if score @s wineffect_select matches 4 run item replace entity @s enderchest.10 with minecraft:lime_dye{CustomModelData:55,Clear:1,display:{Name:'{"translate":"win_effect.pumpkin","color":"green","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.lightspeed_traveler","color":"gold"}]','{"text":" "}','{"translate":"win_effect.equipped","color":"green","bold":false,"italic":false}']},HideFlags:4}
execute if score @s wineffect_select matches 5 run item replace entity @s enderchest.11 with minecraft:lime_dye{CustomModelData:72,Clear:1,display:{Name:'{"translate":"win_effect.ghost","color":"green","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.sniper","color":"gold"}]','{"text":" "}','{"translate":"win_effect.equipped","color":"green","bold":false,"italic":false}']},HideFlags:4}
execute if score @s wineffect_select matches 6 run item replace entity @s enderchest.18 with minecraft:amethyst_shard{Clear:1,display:{Name:'{"translate":"win_effect.witch","color":"green","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.veteran","color":"gold"}]','{"text":" "}','{"translate":"win_effect.equipped","color":"green","bold":false,"italic":false}']},HideFlags:4}
execute if score @s wineffect_select matches 7 run item replace entity @s enderchest.19 with minecraft:gold_ingot{Clear:1,display:{Name:'{"translate":"win_effect.gold","color":"green","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.professional_robbery","color":"gold"}]','{"text":" "}','{"translate":"win_effect.equipped","color":"green","bold":false,"italic":false}']},HideFlags:4}
execute if score @s wineffect_select matches 8 run item replace entity @s enderchest.20 with minecraft:firework_rocket{Clear:1,display:{Name:'{"translate":"win_effect.tnt","color":"green","bold":true,"italic":false}',Lore:['[{"translate":"win_effect.required","color":"gray","italic":false},{"translate":"achievement.warrior","color":"gold"}]','{"text":" "}','{"translate":"win_effect.equipped","color":"green","bold":false,"italic":false}']},HideFlags:4}

execute if score @s wineffect_preview matches 0 run item replace entity @s enderchest.15 with minecraft:lime_dye{CustomModelData:74,Clear:1,display:{Name:'{"text":""}'},HideFlags:4}
execute if score @s wineffect_preview matches 1 run item replace entity @s enderchest.15 with minecraft:lime_dye{CustomModelData:75,Clear:1,display:{Name:'{"text":""}'},HideFlags:4}
execute if score @s wineffect_preview matches 2 run item replace entity @s enderchest.15 with minecraft:lime_dye{CustomModelData:76,Clear:1,display:{Name:'{"text":""}'},HideFlags:4}
execute if score @s wineffect_preview matches 3 run item replace entity @s enderchest.15 with minecraft:lime_dye{CustomModelData:77,Clear:1,display:{Name:'{"text":""}'},HideFlags:4}
execute if score @s wineffect_preview matches 4 run item replace entity @s enderchest.15 with minecraft:lime_dye{CustomModelData:78,Clear:1,display:{Name:'{"text":""}'},HideFlags:4}
execute if score @s wineffect_preview matches 5 run item replace entity @s enderchest.15 with minecraft:lime_dye{CustomModelData:79,Clear:1,display:{Name:'{"text":""}'},HideFlags:4}
execute if score @s wineffect_preview matches 6 run item replace entity @s enderchest.15 with minecraft:lime_dye{CustomModelData:80,Clear:1,display:{Name:'{"text":""}'},HideFlags:4}
execute if score @s wineffect_preview matches 7 run item replace entity @s enderchest.15 with minecraft:lime_dye{CustomModelData:81,Clear:1,display:{Name:'{"text":""}'},HideFlags:4}
execute if score @s wineffect_preview matches 8 run item replace entity @s enderchest.15 with minecraft:lime_dye{CustomModelData:82,Clear:1,display:{Name:'{"text":""}'},HideFlags:4}

item replace entity @s enderchest.4 with minecraft:brown_dye{display:{Name:'{"text":""}'}}
item replace entity @s enderchest.5 with minecraft:brown_dye{display:{Name:'{"text":""}'}}
item replace entity @s enderchest.6 with minecraft:brown_dye{display:{Name:'{"text":""}'}}
item replace entity @s enderchest.7 with minecraft:brown_dye{display:{Name:'{"text":""}'}}
item replace entity @s enderchest.8 with minecraft:purple_dye{display:{Name:'{"text":""}'}}
item replace entity @s enderchest.13 with minecraft:brown_dye{display:{Name:'{"text":""}'}}
item replace entity @s enderchest.14 with minecraft:brown_dye{display:{Name:'{"text":""}'}}
item replace entity @s enderchest.16 with minecraft:brown_dye{display:{Name:'{"text":""}'}}
item replace entity @s enderchest.17 with minecraft:brown_dye{display:{Name:'{"text":""}'}}
item replace entity @s enderchest.22 with minecraft:brown_dye{display:{Name:'{"text":""}'}}
item replace entity @s enderchest.23 with minecraft:brown_dye{display:{Name:'{"text":""}'}}
item replace entity @s enderchest.24 with minecraft:brown_dye{display:{Name:'{"text":""}'}}
item replace entity @s enderchest.25 with minecraft:brown_dye{display:{Name:'{"text":""}'}}
item replace entity @s enderchest.26 with minecraft:brown_dye{display:{Name:'{"text":""}'}}

item replace entity @s enderchest.3 with minecraft:gray_stained_glass_pane{display:{Name:'{"text":""}'}}
item replace entity @s enderchest.12 with minecraft:gray_stained_glass_pane{display:{Name:'{"text":""}'}}
item replace entity @s enderchest.21 with minecraft:gray_stained_glass_pane{display:{Name:'{"text":""}'}}

clear @s minecraft:brown_dye
clear @s minecraft:purple_dye
clear @s minecraft:lime_dye{Clear:1}
clear @s minecraft:red_dye
clear @s minecraft:fire_charge
clear @s minecraft:gold_ingot
clear @s minecraft:amethyst_shard
clear @s minecraft:firework_rocket
clear @s minecraft:gray_stained_glass_pane
clear @s minecraft:barrier