#Reset Last Level
setblock 13 47 150 polished_blackstone_button[powered=false,face=floor,facing=west]
scoreboard players add @p[x=13.49,y=46.00,z=149.40,distance=..3] level 1

#Next Level
execute in overworld run tp @p[x=13.49,y=46.00,z=149.40,distance=..3] -37.46 48.00 154.50 270.15 -0.60
title @p[x=-37.46,y=48.00,z=154.50,distance=..1] actionbar {"text":"Level 20: The End","bold":true,"color":"light_purple"}
playsound block.note_block.chime master @p[x=-37.46,y=48.00,z=154.50,distance=..1] -37.46 48.00 154.50 1 2


#Reset Inventory
clear @p[x=-37.46,y=48.00,z=154.50,distance=..1]
item replace entity @p[x=-37.46,y=48.00,z=154.50,distance=..1] armor.head with white_stained_glass{display:{Name:'[{"text":"Space Helmet","italic":false,"bold":true,"color":"aqua"}]',Lore:['[{"text":"Provides the wearer with the","italic":false,"color":"gray"},{"text":"","italic":false,"color":"dark_purple"}]','[{"text":"ability to breathe in space.","italic":false,"color":"gray"}]']},Enchantments:[{id:binding_curse,lvl:1}],HideFlags:1} 1
item replace entity @p[x=-37.46,y=48.00,z=154.50,distance=..1] container.17 with warped_fungus_on_a_stick{display:{Name:'[{"text":"Right Click:","italic":false,"bold":true,"color":"gold"},{"text":" ","bold":false},{"text":"Return To Hub","bold":false,"color":"white"}]',Lore:['[{"text":"Teleports the player","italic":false,"color":"gray"}]','[{"text":"back to the hub.","italic":false,"color":"gray"}]']}} 1
item replace entity @p[x=-37.46,y=48.00,z=154.50,distance=..1] container.4 with polished_blackstone_button{RepairCost:40,display:{Name:'[{"text":"Polished Blackstone Button","italic":false}]',Lore:['[{"text":"You must find a ","italic":false,"color":"gray"},{"text":"Polished Blackstone Button","underlined":true},{"text":" to progress","underlined":false}]']}} 1
item replace entity @p[x=-37.46,y=48.00,z=154.50,distance=..1] container.0 with ender_eye{RepairCost:40,display:{Name:'[{"text":"Right Click:","italic":false,"bold":true,"color":"gold"},{"text":" ","bold":false},{"text":"Button Locator","bold":false,"color":"white"}]',Lore:['[{"text":"WARNING:","italic":false,"color":"red","bold":true},{"text":" Using this item will","italic":false,"color":"red","bold":false}]','[{"text":"subtract from your total hints.","italic":false,"color":"red"}]']}} 1
execute if score var spyGlass matches 1 run item replace entity @p[x=-37.46,y=48.00,z=154.50,distance=..1] container.8 with spyglass{RepairCost:40,display:{Name:'[{"text":"Magnifier","italic":false,"color":"gold","bold":true}]',Lore:['[{"text":"Hold right-click to","italic":false,"color":"gray"}]','[{"text":"magnify your target.","italic":false,"color":"gray"}]']}} 1