scoreboard objectives add JumpTime dummy

execute as @a at @s if block ~ ~-1 ~ minecraft:lime_concrete run effect give @s jump_boost 1 4 true
execute as @a at @s if block ~0.3 ~-1 ~ minecraft:lime_concrete run effect give @s jump_boost 1 4 true
execute as @a at @s if block ~-0.3 ~-1 ~ minecraft:lime_concrete run effect give @s jump_boost 1 4 true
execute as @a at @s if block ~ ~-1 ~0.3 minecraft:lime_concrete run effect give @s jump_boost 1 4 true
execute as @a at @s if block ~ ~-1 ~-0.3 minecraft:lime_concrete run effect give @s jump_boost 1 4 true

execute as @a at @s if block ~ ~-1 ~ minecraft:light_blue_concrete run effect give @s speed 1 4 true
execute as @a at @s if block ~0.3 ~-1 ~ minecraft:light_blue_concrete run effect give @s speed 1 4 true
execute as @a at @s if block ~-0.3 ~-1 ~ minecraft:light_blue_concrete run effect give @s speed 1 4 true
execute as @a at @s if block ~ ~-1 ~0.3 minecraft:light_blue_concrete run effect give @s speed 1 4 true
execute as @a at @s if block ~ ~-1 ~-0.3 minecraft:light_blue_concrete run effect give @s speed 1 4 true

execute as @a at @s if block ~ ~-1 ~ minecraft:light_gray_concrete run effect give @s slow_falling 5 0 true
execute as @a at @s if block ~0.3 ~-1 ~ minecraft:light_gray_concrete run effect give @s slow_falling 5 0 true
execute as @a at @s if block ~-0.3 ~-1 ~ minecraft:light_gray_concrete run effect give @s slow_falling 5 0 true
execute as @a at @s if block ~ ~-1 ~0.3 minecraft:light_gray_concrete run effect give @s slow_falling 5 0 true
execute as @a at @s if block ~ ~-1 ~-0.3 minecraft:light_gray_concrete run effect give @s slow_falling 5 0 true

#execute as @a at @s if block ~ ~-1 ~ minecraft:black_concrete run effect give @s blindness 5 0 true
#execute as @a at @s if block ~0.3 ~-1 ~ minecraft:black_concrete run effect give @s blindness 5 0 true
#execute as @a at @s if block ~-0.3 ~-1 ~ minecraft:black_concrete run effect give @s blindness 5 0 true
#execute as @a at @s if block ~ ~-1 ~0.3 minecraft:black_concrete run effect give @s blindness 5 0 true
#execute as @a at @s if block ~ ~-1 ~-0.3 minecraft:black_concrete run effect give @s blindness 5 0 true

execute as @a at @s if block ~ ~-1 ~ minecraft:purple_concrete run effect give @s nausea 5 0 true
execute as @a at @s if block ~0.3 ~-1 ~ minecraft:purple_concrete run effect give @s nausea 5 0 true
execute as @a at @s if block ~-0.3 ~-1 ~ minecraft:purple_concrete run effect give @s nausea 5 0 true
execute as @a at @s if block ~ ~-1 ~0.3 minecraft:purple_concrete run effect give @s nausea 5 0 true
execute as @a at @s if block ~ ~-1 ~-0.3 minecraft:purple_concrete run effect give @s nausea 5 0 true

execute as @a[tag=Counting] at @s if block ~ ~-1 ~ minecraft:emerald_block run function parkour:parkour_end
execute as @a[tag=Counting] at @s if block ~0.3 ~-1 ~ minecraft:emerald_block run function parkour:parkour_end
execute as @a[tag=Counting] at @s if block ~-0.3 ~-1 ~ minecraft:emerald_block run function parkour:parkour_end
execute as @a[tag=Counting] at @s if block ~ ~-1 ~0.3 minecraft:emerald_block run function parkour:parkour_end
execute as @a[tag=Counting] at @s if block ~ ~-1 ~-0.3 minecraft:emerald_block run function parkour:parkour_end


execute as @a at @s unless entity @e[name=MagentaJump] if block ~ ~-1 ~ minecraft:magenta_glazed_terracotta[facing=west] run summon armor_stand ~ ~ ~ {Motion:[1.5d,1.0d,0.0d],Invisible:1,CustomName:"{\"text\":\"MagentaJump\"}"}
execute as @a at @s unless entity @e[name=MagentaJump] if block ~ ~-1 ~ minecraft:magenta_glazed_terracotta[facing=east] run summon armor_stand ~ ~ ~ {Motion:[-1.5d,1.0d,0.0d],Invisible:1,CustomName:"{\"text\":\"MagentaJump\"}"}
execute as @a at @s unless entity @e[name=MagentaJump] if block ~ ~-1 ~ minecraft:magenta_glazed_terracotta[facing=south] run summon armor_stand ~ ~ ~ {Motion:[0.0d,1.0d,-1.5d],Invisible:1,CustomName:"{\"text\":\"MagentaJump\"}"}
execute as @a at @s unless entity @e[name=MagentaJump] if block ~ ~-1 ~ minecraft:magenta_glazed_terracotta[facing=north] run summon armor_stand ~ ~ ~ {Motion:[0.0d,1.0d,1.5d],Invisible:1,CustomName:"{\"text\":\"MagentaJump\"}"}
scoreboard players add @e[name=MagentaJump] JumpTime 1
execute as @e[name=MagentaJump] at @s rotated as @p run tp @p ~ ~ ~ ~ ~
execute as @e[name=MagentaJump] at @s run effect give @p slow_falling 5 0 true
execute as @e[name=MagentaJump,scores={JumpTime=20..}] at @s run effect clear @p slow_falling
kill @e[name=MagentaJump,scores={JumpTime=20..}]


#Effect Clear
execute as @a at @s unless block ~ ~-1 ~ air unless block ~ ~-1 ~ #parkour:effect_give run effect clear @s speed
execute as @a at @s unless block ~ ~-1 ~ air unless block ~0.3 ~-1 ~ #parkour:effect_give run effect clear @s speed
execute as @a at @s unless block ~ ~-1 ~ air unless block ~-0.3 ~-1 ~ #parkour:effect_give run effect clear @s speed
execute as @a at @s unless block ~ ~-1 ~ air unless block ~ ~-1 ~0.3 #parkour:effect_give run effect clear @s speed
execute as @a at @s unless block ~ ~-1 ~ air unless block ~ ~-1 ~-0.3 #parkour:effect_give run effect clear @s speed

execute as @a at @s unless block ~ ~-1 ~ air unless block ~ ~-1 ~ #parkour:effect_give run effect clear @s slow_falling
execute as @a at @s unless block ~ ~-1 ~ air unless block ~0.3 ~-1 ~ #parkour:effect_give run effect clear @s slow_falling
execute as @a at @s unless block ~ ~-1 ~ air unless block ~-0.3 ~-1 ~ #parkour:effect_give run effect clear @s slow_falling
execute as @a at @s unless block ~ ~-1 ~ air unless block ~ ~-1 ~0.3 #parkour:effect_give run effect clear @s slow_falling
execute as @a at @s unless block ~ ~-1 ~ air unless block ~ ~-1 ~-0.3 #parkour:effect_give run effect clear @s slow_falling

execute as @a at @s unless block ~ ~-1 ~ air unless block ~ ~-1 ~ #parkour:effect_give run effect clear @s blindness
execute as @a at @s unless block ~ ~-1 ~ air unless block ~0.3 ~-1 ~ #parkour:effect_give run effect clear @s blindness
execute as @a at @s unless block ~ ~-1 ~ air unless block ~-0.3 ~-1 ~ #parkour:effect_give run effect clear @s blindness
execute as @a at @s unless block ~ ~-1 ~ air unless block ~ ~-1 ~0.3 #parkour:effect_give run effect clear @s blindness
execute as @a at @s unless block ~ ~-1 ~ air unless block ~ ~-1 ~-0.3 #parkour:effect_give run effect clear @s blindness

execute as @a at @s unless block ~ ~-1 ~ air unless block ~ ~-1 ~ #parkour:effect_give run effect clear @s nausea
execute as @a at @s unless block ~ ~-1 ~ air unless block ~0.3 ~-1 ~ #parkour:effect_give run effect clear @s nausea
execute as @a at @s unless block ~ ~-1 ~ air unless block ~-0.3 ~-1 ~ #parkour:effect_give run effect clear @s nausea
execute as @a at @s unless block ~ ~-1 ~ air unless block ~ ~-1 ~0.3 #parkour:effect_give run effect clear @s nausea
execute as @a at @s unless block ~ ~-1 ~ air unless block ~ ~-1 ~-0.3 #parkour:effect_give run effect clear @s nausea



execute as @a[gamemode=adventure] at @s if block ~ ~-0.1 ~ #parkour:kill_block run function parkour:kill
execute as @a[gamemode=adventure] at @s if block ~ ~-1.1 ~ #parkour:kill2_block run function parkour:kill


execute as @a[gamemode=adventure] at @s if block ~ ~-1 ~ minecraft:diamond_block run particle minecraft:totem_of_undying ~ ~ ~ 1 1 1 1 100 force
execute as @a[gamemode=adventure] at @s if block ~ ~-1 ~ minecraft:diamond_block run playsound minecraft:entity.player.levelup master @s ~ ~ ~ 1
execute as @a[gamemode=adventure] at @s if block ~ ~-1 ~ minecraft:diamond_block run setblock ~ ~-1 ~ gold_block
execute as @a[gamemode=adventure] at @s if block ~ ~-1 ~ minecraft:gold_block run spawnpoint @s ~ ~ ~
execute as @a[gamemode=adventure] at @s if block ~ ~-1 ~ minecraft:gold_block run function parkour:spawnpoint

gamemode adventure @a[gamemode=survival]

team add Player
team join Player @a
team modify Player collisionRule never
team modify Player friendlyFire false
team modify Player deathMessageVisibility never
team modify Player color gold

effect give @a saturation 999999 1 true
effect give @a night_vision 999999 1 true