#Quality assurance commands
execute as @e[type=minecraft:minecart] at @s unless entity @a[distance=..10] unless entity @s[x=27,y=46,z=-345,distance=..3] unless entity @s[x=10,y=107,z=-221,distance=..3] run kill @s
execute as @e[type=player,x=11,y=70,z=-59,dx=-12,dy=-3,dz=-1] at @s unless entity @e[type=minecraft:minecart,x=11,y=70,z=-59,dx=-12,dy=-3,dz=-1] run tellraw @s {"text":"You need to be in a minecart to continue!","color":"light_purple"}
execute as @e[type=player,x=11,y=70,z=-59,dx=-12,dy=-3,dz=-1] at @s unless entity @e[type=minecraft:minecart,x=11,y=70,z=-59,dx=-12,dy=-3,dz=-1] run tp @s 6 67 -51 180 0
execute if block 4 67 -58 chest{Items:[]} run setblock 4 67 -58 minecraft:barrier
execute if block 4 67 -58 minecraft:barrier run setblock 4 67 -58 chest[facing=south]{Items:[{Slot:0b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:1b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:2b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:3b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:4b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:5b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:6b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:7b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:8b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:9b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:10b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:11b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:12b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:13b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:14b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:15b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:16b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:17b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:18b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:19b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:20b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:21b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:22b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:23b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:24b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:25b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:26b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}}]} replace
execute if block 8 67 -58 chest{Items:[]} run setblock 8 67 -58 minecraft:barrier
execute if block 8 67 -58 minecraft:barrier run setblock 8 67 -58 chest[facing=south]{Items:[{Slot:0b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:1b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:2b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:3b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:4b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:5b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:6b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:7b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:8b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:9b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:10b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:11b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:12b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:13b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:14b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:15b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:16b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:17b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:18b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:19b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:20b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:21b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:22b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:23b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:24b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:25b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}},{Slot:26b,id:"minecraft:minecart",Count:1b,tag:{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16}}]} replace
execute as @e[type=minecraft:player] at @s unless entity @e[type=minecraft:minecart,distance=..10] unless entity @s[x=-19,y=90,z=-59,dx=53,dy=-37,dz=43] unless entity @s[x=-20,y=104,z=-119,dx=59,dy=34,dz=-115] unless entity @s[x=-18,y=-38,z=-108,dx=55,dy=29,dz=-82] unless entity @s[nbt={Inventory:[{id:"minecraft:minecart"}]}] run tellraw @s {"text":"Looks like you've lost your minecart! Here's a brand new one!","color":"light_purple","italic":true}
execute as @e[type=minecraft:player] at @s unless entity @e[type=minecraft:minecart,distance=..10] unless entity @s[x=-19,y=90,z=-59,dx=53,dy=-37,dz=43] unless entity @s[x=-20,y=104,z=-119,dx=59,dy=34,dz=-115] unless entity @s[x=-18,y=-38,z=-108,dx=55,dy=29,dz=-82] unless entity @s[nbt={Inventory:[{id:"minecraft:minecart"}]}] run playsound minecraft:entity.item.pickup master @s ~ ~ ~ 1000 0.5 1
execute as @e[type=minecraft:player] at @s unless entity @e[type=minecraft:minecart,distance=..10] unless entity @s[x=-19,y=90,z=-59,dx=53,dy=-37,dz=43] unless entity @s[x=-20,y=104,z=-119,dx=59,dy=34,dz=-115] unless entity @s[x=-18,y=-38,z=-108,dx=55,dy=29,dz=-82] unless entity @s[nbt={Inventory:[{id:"minecraft:minecart"}]}] run playsound minecraft:block.note_block.pling master @s ~ ~ ~ 1000 2 1
execute as @e[type=minecraft:player] at @s unless entity @e[type=minecraft:minecart,distance=..10] unless entity @s[x=-19,y=90,z=-59,dx=53,dy=-37,dz=43] unless entity @s[x=-20,y=104,z=-119,dx=59,dy=34,dz=-115] unless entity @s[x=-18,y=-38,z=-108,dx=55,dy=29,dz=-82] unless entity @s[nbt={Inventory:[{id:"minecraft:minecart"}]}] run give @s minecart{CanPlaceOn:["minecraft:rail","minecraft:powered_rail","minecraft:detector_rail","minecraft:activator_rail"],HideFlags:16} 1
kill @e[type=item,nbt={Item:{id:"minecraft:pointed_dripstone"}}]
kill @e[type=item,nbt={Item:{id:"minecraft:nether_star"}}]
execute as @a[nbt={foodLevel:19}] run effect give @a minecraft:saturation 1 1 true
execute as @e[type=minecraft:item,nbt={Item:{id:"minecraft:player_head"}}] run data merge entity @s {Fire:-72000,HasVisualFire:0b,Health:72000,Glowing:1}
execute as @e[type=item,nbt={Item:{id:"minecraft:player_head"}}] at @s run particle minecraft:soul_fire_flame ~ ~ ~ 0.25 0.25 0.25 0.01 1 force

#World spawn
execute as @e[type=player,x=6,y=67,z=-34,distance=..3] at @s unless entity @s[tag=S] run gamemode adventure @s
execute as @e[type=player,x=6,y=67,z=-34,distance=..3] at @s unless entity @s[tag=S] run team join A @s
execute as @e[type=player,x=6,y=67,z=-34,distance=..3] at @s unless entity @s[tag=S] run advancement grant @s from minecraft:recipes/root
execute as @e[type=player,x=6,y=67,z=-34,distance=..3] at @s unless entity @s[tag=S] run recipe take @s *
execute as @e[type=player,x=6,y=67,z=-34,distance=..3] at @s unless entity @s[tag=S] run tp @s 6 67 -34 -180 0
execute as @e[type=player,x=6,y=67,z=-34,distance=..3] at @s unless entity @s[tag=S] run tag @s add S

#Roller Coaster effects
execute as @e[type=minecraft:player,x=6,y=67,z=-62,distance=..2] at @s if entity @e[type=minecraft:minecart,x=6,y=67,z=-62,distance=..2] run function commands:effects
execute as @e[type=minecraft:player] unless entity @s[type=minecraft:player,x=6,y=67,z=-62,distance=..2] run tag @s remove 1

execute as @e[type=minecraft:player,x=5,y=68,z=-66,distance=..2] at @s if entity @e[type=minecraft:minecart,x=5,y=68,z=-66,distance=..2] run function commands:effects
execute as @e[type=minecraft:player] unless entity @s[type=minecraft:player,x=5,y=68,z=-66,distance=..2] run tag @s remove 2

execute as @e[tag=S1] at @s run tp @s ~ ~ ~ facing entity @e[tag=S2,limit=1]
execute as @e[tag=S2,x=45,y=60,z=-85,distance=..2] run kill @s

execute as @e[type=minecraft:player,x=4,y=65,z=-77,distance=..2] at @s if entity @e[type=minecraft:minecart,x=4,y=65,z=-77,distance=..2] run function commands:effects
execute as @e[type=minecraft:player] unless entity @s[type=minecraft:player,x=4,y=65,z=-77,distance=..2] run tag @s remove 3

execute as @e[type=minecraft:player,x=53,y=67,z=-116,distance=..2] at @s if entity @e[type=minecraft:minecart,x=53,y=67,z=-116,distance=..2] run function commands:effects
execute as @e[type=minecraft:player] unless entity @s[type=minecraft:player,x=53,y=67,z=-116,distance=..2] run tag @s remove 4

particle dust 0.102 1.000 0.071 1 12 70 -83 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 19 66 -95 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 18 66 -88 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 28 67 -88 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 18 67 -99 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 26 67 -97 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 30 68 -79 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 27 76 -98 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 42 67 -85 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 43 68 -89 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 40 66 -79 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 57 70 -83 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 40 76 -83 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 56 78 -87 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 50 66 -100 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 48 67 -106 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 52 77 -112 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 51 67 -119 0.75 0.75 0.75 0.01 2 force

execute as @e[tag=S3] at @s if entity @e[type=minecraft:player,distance=..15] run tp @s ~ ~ ~ -90 0
execute at @e[tag=SKULL] run particle minecraft:witch ~ ~ ~ 0.25 0.25 0.25 1 1 force

execute as @e[type=minecraft:player,x=77,y=65,z=-151,distance=..2] at @s if entity @e[type=minecraft:minecart,x=77,y=65,z=-151,distance=..2] run function commands:effects
execute as @e[type=minecraft:player] unless entity @s[type=minecraft:player,x=77,y=65,z=-151,distance=..2] run tag @s remove 5

execute as @e[type=minecart,x=73,y=57,z=-166,distance=..3] at @s run data merge entity @s {Motion:[0.0,0.08,-0.8]}
execute as @e[type=minecart,x=73,y=57,z=-166,distance=..3] at @s unless entity @s[tag=MINECART] run data merge entity @s {Tags:["MINECART"]}
execute as @e[type=minecart,x=45,y=50,z=-186,distance=..3] at @s run data merge entity @s {Motion:[-2.0,0.03,0.0]}
execute as @e[type=minecart,x=45,y=50,z=-186,distance=..3] at @s unless entity @s[tag=MINECART2] run data merge entity @s {Tags:["MINECART2"]}
execute as @e[type=minecart,x=35,y=39,z=-186,distance=..3] at @s run data merge entity @s {Motion:[-1.0,0.03,0.0]}
execute as @e[type=minecart,x=35,y=39,z=-186,distance=..3] at @s unless entity @s[tag=MINECART3] run data merge entity @s {Tags:["MINECART3"]}
execute as @e[type=minecart,x=-43,y=34,z=-163,distance=..3] at @s run data merge entity @s {Motion:[0.0,1.5,2.0]}
execute as @e[type=minecart,x=-43,y=34,z=-163,distance=..3] at @s unless entity @s[tag=MINECART4] run playsound minecraft:block.slime_block.fall master @a -43 34 -164 0.5 0.5 0
execute as @e[type=minecart,x=-43,y=34,z=-163,distance=..3] at @s unless entity @s[tag=MINECART4] run particle minecraft:block slime_block -43 34 -164 1 1 1 0.1 100 force
execute as @e[type=minecart,x=-43,y=34,z=-163,distance=..3] at @s unless entity @s[tag=MINECART4] run data merge entity @s {Tags:["MINECART4"]}

execute as @e[type=minecraft:player,x=45,y=50,z=-186,distance=..2] at @s if entity @e[type=minecraft:minecart,x=45,y=50,z=-186,distance=..2] run function commands:effects
execute as @e[type=minecraft:player] unless entity @s[type=minecraft:player,x=45,y=50,z=-186,distance=..2] run tag @s remove 6

particle falling_dust packed_ice 74 59 -161 3 4 8 1 1 force
particle falling_dust packed_ice 58 54 -187 8 4 6 1 1 force
particle falling_dust packed_ice 11 41 -186 16 10 16 1 4 force
particle falling_dust packed_ice -42 38 -181 8 6 8 1 2 force
particle falling_dust packed_ice -42 50 -144 6 4 6 1 1 force
particle falling_dust packed_ice 5 49 -125 10 4 10 1 2 force
particle falling_dust packed_ice 42 54 -119 6 4 6 1 1 force

execute as @e[tag=STRAY] at @s run tp @s ~ ~ ~ facing entity @p

particle dust 0.102 1.000 0.071 1 46 63 -158 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 38 74 -163 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 24 67 -170 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 21 72 -156 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 0 66 -164 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 -3 79 -167 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 -11 66 -178 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 -26 70 -172 0.75 0.75 0.75 0.01 2 force

execute as @e[type=minecraft:player,x=-45,y=67,z=-177,distance=..2] at @s if entity @e[type=minecraft:minecart,x=-45,y=67,z=-177,distance=..2] run function commands:effects
execute as @e[type=minecraft:player] unless entity @s[type=minecraft:player,x=-45,y=67,z=-177,distance=..2] run tag @s remove 7

execute as @e[type=minecraft:player,x=-55,y=67,z=-159,distance=..2] at @s if entity @e[type=minecraft:minecart,x=-55,y=67,z=-159,distance=..2] run function commands:effects
execute as @e[type=minecraft:player] unless entity @s[type=minecraft:player,x=-55,y=67,z=-159,distance=..2] run tag @s remove 8

execute as @e[type=minecraft:player,x=-62,y=67,z=-140,distance=..2] at @s if entity @e[type=minecraft:minecart,x=-62,y=67,z=-140,distance=..2] run function commands:effects
execute as @e[type=minecraft:player] unless entity @s[type=minecraft:player,x=-62,y=67,z=-140,distance=..2] run tag @s remove 9

execute as @e[type=minecraft:player,x=-25,y=45,z=-140,distance=..2] at @s if entity @e[type=minecraft:minecart,x=-25,y=45,z=-140,distance=..2] run function commands:effects
execute as @e[type=minecraft:player] unless entity @s[type=minecraft:player,x=-25,y=45,z=-140,distance=..2] run tag @s remove 10

execute as @e[type=minecraft:player,x=38,y=51,z=-118,distance=..2] at @s if entity @e[type=minecraft:minecart,x=38,y=51,z=-118,distance=..2] run function commands:effects
execute as @e[type=minecraft:player] unless entity @s[type=minecraft:player,x=38,y=51,z=-118,distance=..2] run tag @s remove 11

execute as @e[tag=SM2,limit=1,x=1,y=66,z=-163,distance=..2] at @s run tp @s ~ ~ ~ 145 20
execute as @e[tag=S4] at @s run tp @s ~ ~ ~ 90 0

execute if entity @e[type=minecraft:player,x=-64,y=67,z=-133,distance=..2] if entity @e[type=minecraft:minecart,x=-64,y=67,z=-133,distance=..2] run execute as @e[type=minecart,x=-64,y=67,z=-133,distance=..2] at @s unless entity @s[tag=SLOW] run data merge entity @s {Motion:[0.0,0.0,0.4]}
execute as @e[type=minecraft:minecart] unless entity @s[x=-64,y=67,z=-133,distance=..2] unless entity @s[x=81,y=67,z=-130,distance=..2] run tag @s remove SLOW

execute if entity @e[type=minecraft:player,x=81,y=67,z=-130,distance=..2] if entity @e[type=minecraft:minecart,x=81,y=67,z=-130,distance=..2] run execute as @e[type=minecart,x=81,y=67,z=-130,distance=..2] at @s unless entity @s[tag=SLOW] run data merge entity @s {Motion:[0.0,0.0,-0.4]}

particle dust 0.102 1.000 0.071 1 -14 68 -119 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 0 74 -118 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 6 68 -129 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 14 69 -122 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 13 76 -133 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 39 71 -141 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 35 79 -134 0.75 0.75 0.75 0.01 2 force
particle dust 0.102 1.000 0.071 1 26 77 -122 0.75 0.75 0.75 0.01 2 force

execute as @e[type=minecart,x=36,y=71,z=-149,distance=..3] at @s run data merge entity @s {Motion:[0.0,1.5,-2.0]}
execute as @e[type=minecart,x=36,y=71,z=-149,distance=..3] at @s unless entity @s[tag=MINECART5] run playsound minecraft:block.slime_block.fall master @a 36 71 -149 0.5 0.5 0
execute as @e[type=minecart,x=36,y=71,z=-149,distance=..3] at @s unless entity @s[tag=MINECART5] run particle minecraft:block slime_block 36 71 -149 1 1 1 0.1 100 force
execute as @e[type=minecart,x=36,y=71,z=-149,distance=..3] at @s unless entity @s[tag=MINECART5] run data merge entity @s {Tags:["MINECART5"]}

execute as @e[type=minecraft:player,x=36,y=82,z=-157,distance=..2] at @s if entity @e[type=minecraft:minecart,x=36,y=82,z=-157,distance=..2] run function commands:effects
execute as @e[type=minecraft:player] unless entity @s[type=minecraft:player,x=36,y=82,z=-157,distance=..2] run tag @s remove 12

execute as @e[type=minecraft:player,x=28,y=82,z=-162,distance=..2] at @s if entity @e[type=minecraft:minecart,x=28,y=82,z=-162,distance=..2] run function commands:effects
execute as @e[type=minecraft:player] unless entity @s[type=minecraft:player,x=28,y=82,z=-162,distance=..2] run tag @s remove 13

execute as @e[tag=SPIDER,x=14,y=83,z=-163,distance=..3] at @s run tp @s ~ ~ ~ facing entity @e[tag=SILVER,sort=nearest,limit=1]

execute if entity @e[type=minecraft:player,x=2,y=86,z=-171,distance=..2] if entity @e[type=minecraft:minecart,x=2,y=86,z=-171,distance=..2] run execute as @e[type=minecart,x=2,y=86,z=-171,distance=..2] at @s unless entity @s[tag=SLOW] run data merge entity @s {Motion:[0.0,0.0,-0.35]}

execute as @e[type=minecraft:player,x=-2,y=67,z=-124,distance=..2] at @s if entity @e[type=minecraft:minecart,x=-2,y=67,z=-124,distance=..2] run function commands:effects
execute as @e[type=minecraft:player] unless entity @s[type=minecraft:player,x=-2,y=67,z=-124,distance=..2] run tag @s remove 14

execute if entity @e[type=minecraft:minecart,x=27,y=47,z=-345,distance=..2] run execute if entity @e[type=minecraft:player,x=27,y=47,z=-345,distance=..2] run execute as @e[type=minecraft:player,x=27,y=47,z=-345,distance=..2] run playsound minecraft:block.portal.travel master @s ~ ~ ~ 3 0.8 1
execute if entity @e[type=minecraft:minecart,x=27,y=47,z=-345,distance=..2] run execute if entity @e[type=minecraft:player,x=27,y=47,z=-345,distance=..2] run execute as @e[type=minecraft:minecart,x=27,y=47,z=-345,distance=..2] at @s run tp @s 10 108 -221 0 0
execute if entity @e[type=minecraft:minecart,x=10,y=108,z=-221,distance=..2] run execute if entity @e[type=minecraft:player,x=10,y=108,z=-221,distance=..2] run execute as @e[type=minecraft:player,x=10,y=108,z=-221,distance=..2] at @s unless entity @s[tag=TOP] run tp @s ~ ~1 ~ 0 0
execute if entity @e[type=minecraft:minecart,x=10,y=108,z=-221,distance=..2] run execute if entity @e[type=minecraft:player,x=10,y=108,z=-221,distance=..2] run execute as @e[type=minecraft:player,x=10,y=108,z=-221,distance=..2] at @s unless entity @s[tag=TOP] run tag @s add TOP

execute as @e[type=minecraft:player,x=0,y=64,z=-240,distance=..2] at @s if entity @e[type=minecraft:minecart,x=0,y=64,z=-240,distance=..2] run function commands:effects
execute as @e[type=minecraft:player] unless entity @s[type=minecraft:player,x=0,y=64,z=-240,distance=..2] run tag @s remove 15

execute as @e[type=minecraft:player,x=2,y=86,z=-188,distance=..2] at @s if entity @e[type=minecraft:minecart,x=2,y=86,z=-188,distance=..2] run function commands:effects
execute as @e[type=minecraft:player] unless entity @s[type=minecraft:player,x=2,y=86,z=-188,distance=..2] run tag @s remove 16

execute as @e[type=minecraft:player,x=0,y=64,z=-242,distance=..2] at @s if entity @e[type=minecraft:minecart,x=0,y=64,z=-242,distance=..2] run function commands:effects
execute as @e[type=minecraft:player] unless entity @s[type=minecraft:player,x=0,y=64,z=-242,distance=..2] run tag @s remove 17

particle falling_dust packed_ice 6 130 -145 8 6 6 1 10 force
particle minecraft:wax_off 6 130 -145 8 6 6 0.1 1 force
particle minecraft:end_rod 6 130 -145 8 6 6 0.1 1 force

execute as @e[tag=SPAWNV] at @s unless entity @s[x=2,y=66,z=-54,distance=..3] run tp @s 2 66 -54
execute as @e[scores={villager=1..}] at @s run scoreboard players add @s textscore 1
execute as @e[scores={textscore=10}] at @s run playsound minecraft:entity.villager.ambient master @s 2 66 -54 1000 0.8 1
execute as @e[scores={textscore=10}] at @s run tellraw @s [{"text":"Bob","color":"light_purple","italic":false},{"text":": Hello ","color":"yellow","italic":false},{"selector":"@s","color":"aqua","italic":false},{"text":"! I've been expecting you.","color":"yellow","italic":false}]
execute as @e[scores={textscore=70}] at @s run playsound minecraft:entity.villager.ambient master @s 2 66 -54 1000 0.8 1
execute as @e[scores={textscore=70}] at @s run tellraw @s [{"text":"Bob","color":"light_purple","italic":false},{"text":": As you've probably heard, there has been multiple reports of other pointy ear creatures encountering an ancient evil in the","color":"yellow","italic":false},{"text":" Road to The Ancient Snowflake Tree","color":"gold","italic":false},{"text":".","color":"yellow","italic":false}]
execute as @e[scores={textscore=130}] at @s run playsound minecraft:entity.villager.ambient master @s 2 66 -54 1000 0.8 1
execute as @e[scores={textscore=130}] at @s run tellraw @s [{"text":"Bob","color":"light_purple","italic":false},{"text":": You mission is to reach","color":"yellow","italic":false},{"text":" The Ancient Snowflake Tree","color":"gold","italic":false},{"text":" and defeat the ancien evil.","color":"yellow","italic":false}]
execute as @e[scores={textscore=190}] at @s run playsound minecraft:entity.villager.ambient master @s 2 66 -54 1000 0.8 1
execute as @e[scores={textscore=190}] at @s run tellraw @s [{"text":"Bob","color":"light_purple","italic":false},{"text":": Good Luck!","color":"yellow","italic":false}]

execute at @e[tag=WITHER] run particle minecraft:soul_fire_flame ~ ~1 ~ 0.5 0.5 0.5 0.01 1 force
execute at @e[tag=WITHER] run particle minecraft:soul ~ ~1 ~ 0.5 0.5 0.5 0.01 1 force

#CUTSCENE
execute if score camera camera matches 1..60 run execute as @a[gamemode=spectator] at @s run spectate @e[type=item_display,tag=camera,sort=nearest,limit=1]
execute if score camera camera matches 61..120 run execute as @a[gamemode=spectator] at @s run spectate @e[type=item_display,tag=camera2,sort=nearest,limit=1]
execute if score camera camera matches 121..180 run execute as @a[gamemode=spectator] at @s run spectate @e[type=item_display,tag=camera3,sort=nearest,limit=1]
execute if score camera camera matches 181..240 run execute as @a[gamemode=spectator] at @s run spectate @e[type=item_display,tag=camera4,sort=nearest,limit=1]
execute if score camera camera matches 241..300 run execute as @a[gamemode=spectator] at @s run spectate @e[type=item_display,tag=camera5,sort=nearest,limit=1]
execute if score camera camera matches 301..360 run execute as @a[gamemode=spectator] at @s run spectate @e[type=item_display,tag=camera6,sort=nearest,limit=1]
execute if score camera camera matches 361..420 run execute as @a[gamemode=spectator] at @s run spectate @e[type=item_display,tag=camera7,sort=nearest,limit=1]
execute if score camera camera matches 421 run kill @e[type=minecraft:item_display]
execute if score camera camera matches 421 run stopsound @a master minecraft:music_disc.13
execute if score camera camera matches 421 run gamemode adventure @a
execute if score camera camera matches 430 run execute as @e[type=player] at @s run tellraw @s [{"selector":"@s","color":"aqua","italic":false},{"text":": Time to defeat this \"ancient evil\"","color":"yellow","italic":false}]
execute if score camera camera matches 470 run execute as @e[type=player] at @s run give @s iron_sword{display:{Name:'{"text":"Sharp Iron Sword","color":"green","italic":false}',Lore:['{"text":"Weapon","color":"dark_gray","italic":false}','[{"text":"Attack Damage:","color":"gray","italic":false},{"text":" 8","color":"red","italic":false}]']},HideFlags:7,Unbreakable:1b,Enchantments:[{id:"minecraft:sharpness",lvl:3s}]} 1
execute if score camera camera matches 470 run execute as @e[type=player] at @s run give @s bow{display:{Name:'{"text":"Spruce Bow","color":"green","italic":false}',Lore:['{"text":"Weapon","color":"dark_gray","italic":false}','[{"text":"Range Damage:","color":"gray","italic":false},{"text":" 2","color":"red","italic":false},{"text":"-","color":"gray","italic":false},{"text":"14","color":"red","italic":false}]']},HideFlags:7,Unbreakable:1b,Enchantments:[{id:"minecraft:infinity",lvl:1s},{id:"minecraft:power",lvl:1s}]} 1
execute if score camera camera matches 470 run execute as @e[type=player] at @s run give @s minecraft:golden_apple 2
execute if score camera camera matches 470 run execute as @e[type=player] at @s run give @s splash_potion{display:{Name:'{"text":"Strong Splash Potion of Healing","color":"blue","italic":false}',Lore:['{"text":"Potion","color":"dark_gray","italic":false}','[{"text":"Restores","color":"gray","italic":false},{"text":" 8","color":"#A8FF52","italic":false},{"text":" (","color":"gray","italic":false},{"text":"❤❤❤❤","color":"red","italic":false},{"text":") health.","color":"gray","italic":false}]']},HideFlags:32,Potion:"minecraft:strong_healing"} 2
execute if score camera camera matches 470 run execute as @e[type=player] at @s run give @s splash_potion{display:{Name:'{"text":"Strong Splash Potion of Regeneration","color":"blue","italic":false}',Lore:['{"text":"Potion","color":"dark_gray","italic":false}','[{"text":"Duration:","color":"gray","italic":false},{"text":" 45sec","color":"yellow","italic":false},{"text":".","color":"gray","italic":false}]','[{"text":"Regenerates","color":"gray","italic":false},{"text":" 0.4","color":"#A8FF52","italic":false},{"text":" Health every second.","color":"gray","italic":false}]']},HideFlags:32,custom_potion_effects:[{id:"minecraft:regeneration",amplifier:1b,duration:900,show_particles:1b}],Potion:"minecraft:regeneration"} 1
execute if score camera camera matches 470 run execute as @e[type=player] at @s run give @s shield{display:{Name:'{"text":"Frozen Shield","color":"blue","italic":false}',Lore:['{"text":"Combat Item","color":"dark_gray","italic":false}','{"text":"Used for protecting holders against attacks.","color":"gray","italic":false}']},HideFlags:36,Unbreakable:1b,Enchantments:[{}],BlockEntityTag:{Base:3,Patterns:[{Color:11,Pattern:"flo"},{Color:9,Pattern:"gra"},{Color:11,Pattern:"tts"},{Color:11,Pattern:"bts"},{Color:9,Pattern:"cbo"}]}} 1
execute if score camera camera matches 470 run execute as @e[type=player] at @s run give @s arrow{display:{Lore:['{"text":"Ammunition","color":"dark_gray","italic":false}']}} 64
execute if score camera camera matches 470 run execute as @e[type=player] at @s run item replace entity @s armor.head with iron_helmet{display:{Name:'{"text":"Enchanted Iron Helmet","color":"green","italic":false}',Lore:['{"text":"Armor","color":"dark_gray","italic":false}','[{"text":"Armor:","color":"gray","italic":false},{"text":" +2","color":"dark_green","italic":false}]']},HideFlags:135,Unbreakable:1b,Enchantments:[{id:"minecraft:protection",lvl:2s}],Trim:{material:"minecraft:quartz",pattern:"minecraft:rib"}} 1
execute if score camera camera matches 470 run execute as @e[type=player] at @s run item replace entity @s armor.chest with iron_chestplate{display:{Name:'{"text":"Enchanted Iron Chestplate","color":"green","italic":false}',Lore:['{"text":"Armor","color":"dark_gray","italic":false}','[{"text":"Armor:","color":"gray","italic":false},{"text":" +6","color":"dark_green","italic":false}]']},HideFlags:135,Unbreakable:1b,Enchantments:[{id:"minecraft:protection",lvl:2s}],Trim:{material:"minecraft:quartz",pattern:"minecraft:rib"}} 1
execute if score camera camera matches 470 run execute as @e[type=player] at @s run item replace entity @s armor.legs with iron_leggings{display:{Name:'{"text":"Enchanted Iron Leggings","color":"green","italic":false}',Lore:['{"text":"Armor","color":"dark_gray","italic":false}','[{"text":"Armor:","color":"gray","italic":false},{"text":" +5","color":"dark_green","italic":false}]']},HideFlags:135,Unbreakable:1b,Enchantments:[{id:"minecraft:protection",lvl:2s}],Trim:{material:"minecraft:quartz",pattern:"minecraft:rib"}} 1
execute if score camera camera matches 470 run execute as @e[type=player] at @s run item replace entity @s armor.feet with iron_boots{display:{Name:'{"text":"Enchanted Iron Boots","color":"green","italic":false}',Lore:['{"text":"Armor","color":"dark_gray","italic":false}','[{"text":"Armor:","color":"gray","italic":false},{"text":" +2","color":"dark_green","italic":false}]']},HideFlags:135,Unbreakable:1b,Enchantments:[{id:"minecraft:protection",lvl:2s}],Trim:{material:"minecraft:quartz",pattern:"minecraft:rib"}} 1
execute if score camera camera matches 421..480 run tp @a 10 110 -173 15 0

execute if score camera camera matches 1 run summon item_display 9 111 -173 {view_range:0f,teleport_duration:59,Tags:["camera"],item:{id:"minecraft:air",Count:1b},Rotation:[5f,30f]}
execute if score camera camera matches 1 run gamemode spectator @a
execute if score camera camera matches 1 run execute as @e[type=minecraft:player] run playsound minecraft:music_disc.13 master @s ~ ~ ~ 1000 0.8 1
execute if score camera camera matches 1 run tp @e[tag=camera] 9 111 -169 -5 -10
execute if score camera camera matches 61 run summon item_display 9 111 -169 {view_range:0f,teleport_duration:59,Tags:["camera2"],item:{id:"minecraft:air",Count:1b},Rotation:[-5f,-10f]}
execute if score camera camera matches 61 run tp @e[tag=camera2] 10 113 -166 15 10
execute if score camera camera matches 121 run summon item_display 10 113 -166 {view_range:0f,teleport_duration:59,Tags:["camera3"],item:{id:"minecraft:air",Count:1b},Rotation:[15f,10f]}
execute if score camera camera matches 121 run tp @e[tag=camera3] 11 116 -159 60 22
execute if score camera camera matches 181 run summon item_display 11 116 -159 {view_range:0f,teleport_duration:59,Tags:["camera4"],item:{id:"minecraft:air",Count:1b},Rotation:[60f,22f]}
execute if score camera camera matches 181 run tp @e[tag=camera4] 7 113 -157 69 24
execute if score camera camera matches 241 run summon item_display 2 119 -161 {view_range:0f,teleport_duration:59,Tags:["camera5"],item:{id:"minecraft:air",Count:1b},Rotation:[-31f,-18f]}
execute if score camera camera matches 241 run tp @e[tag=camera5] 7 119 -160 -25 -24
execute if score camera camera matches 301 run summon item_display 7 119 -169 {view_range:0f,teleport_duration:59,Tags:["camera6"],item:{id:"minecraft:air",Count:1b},Rotation:[4f,3f]}
execute if score camera camera matches 301 run tp @e[tag=camera6] 8 121 -176 4 1
execute if score camera camera matches 361 run summon item_display 8 121 -176 {view_range:0f,teleport_duration:59,Tags:["camera7"],item:{id:"minecraft:air",Count:1b},Rotation:[4f,1f]}
execute if score camera camera matches 361 run tp @e[tag=camera7] 8 124 -181 6 8

