execute as @e[tag=slider] run scoreboard players operation @s sliderlife -= @s sliderlifespeed

execute as @e[tag=slider,scores={sliderlife=..1}] as @e[tag=sliderspawner,scores={slidespawnque=..0},limit=1] at @s run setblock ~ ~1 ~ minecraft:emerald_block
execute as @e[tag=slider,scores={sliderlife=..1}] as @e[tag=sliderspawner] at @s if block ~ ~1 ~ minecraft:emerald_block run kill @s
execute as @e[tag=slider,scores={sliderlife=..1}] run scoreboard players remove @e[tag=sliderspawner] slidespawnque 1
execute as @e[tag=slider,scores={sliderlife=..1}] positioned ~ ~100 ~ run scoreboard players remove @p slidespawners 1
execute as @e[tag=slider,scores={sliderlife=..1}] at @s positioned ~ ~1.50 ~ run kill @e[tag=slider_piece,distance=..0.5]
execute as @e[tag=slider,scores={sliderlife=..1}] run kill @s

execute as @e[tag=sliderspawner] at @s run particle minecraft:composter ~ ~1.5 ~ 0.125 0.125 0.125 0.1 2

execute as @e[tag=slider,scores={sliderlife=30}] at @s run playsound minecraft:entity.wither_skeleton.hurt block @a
execute as @e[tag=slider,scores={sliderlife=20}] at @s run playsound minecraft:entity.wither_skeleton.hurt block @a
execute as @e[tag=slider,scores={sliderlife=10}] at @s run playsound minecraft:entity.wither_skeleton.hurt block @a
execute as @e[tag=slider,scores={sliderlife=2}] at @s run playsound minecraft:entity.wither_skeleton.death block @a

execute as @e[tag=slider,scores={sliderlife=199}] at @s run fill ~ ~2.5 ~ ~ ~2.5 ~ minecraft:air replace minecraft:emerald_block

tag @e remove ridingup
execute as @e[tag=slider] at @s rotated as @s run function q:sliderslide
execute as @a[tag=ridingup] at @s run function q:slider_up_collide
effect give @a[tag=ridingup] minecraft:levitation 1 255 true
effect give @a[tag=ridingup] minecraft:jump_boost 1 128 true

execute as @a if score @s slide_create matches 1.. at @s positioned ~ ~1.6 ~ positioned ^ ^ ^0.5 run function q:slidersloop
execute as @a if score @s slide_create matches 1.. at @s positioned ~ ~1.6 ~ positioned ^-0.5 ^ ^0.5 run function q:slidersloop
execute as @a if score @s slide_create matches 1.. at @s positioned ~ ~1.6 ~ positioned ^0.5 ^ ^0.5 run function q:slidersloop
execute as @a if score @s slide_create matches 1.. at @s positioned ~ ~1.6 ~ positioned ^ ^-0.5 ^0.5 run function q:slidersloop
execute as @a if score @s slide_create matches 1.. at @s positioned ~ ~1.6 ~ positioned ^ ^0.5 ^0.5 run function q:slidersloop
execute as @a if score @s slide_create matches 1.. at @s positioned ~ ~1.6 ~ positioned ^-0.5 ^-0.5 ^0.5 run function q:slidersloop
execute as @a if score @s slide_create matches 1.. at @s positioned ~ ~1.6 ~ positioned ^-0.5 ^0.5 ^0.5 run function q:slidersloop
execute as @a if score @s slide_create matches 1.. at @s positioned ~ ~1.6 ~ positioned ^0.5 ^-0.5 ^0.5 run function q:slidersloop
execute as @a if score @s slide_create matches 1.. at @s positioned ~ ~1.6 ~ positioned ^0.5 ^0.5 ^0.5 run function q:slidersloop
