execute @a[ry=-68,rym=-112] ~ ~ ~ detect ~0.5 ~ ~ magma 0 execute @s ~ ~ ~ detect ~2 ~ ~ air 0 execute @s ~ ~ ~ summon item_frame ~1 ~ ~ {Tags:["tsPushMagmaSpawn"]}
execute @a[ry=-68,rym=-112] ~ ~ ~ detect ~0.5 ~ ~ magma 0 execute @s ~ ~ ~ detect ~2 ~ ~ air 0 execute @s ~ ~ ~ execute @e[tag=tsPushMagmaSpawn,c=1] ~ ~ ~ summon armor_stand ~ ~-0.5 ~0.475 {Tags:["tsPushMagma","tsPushMagmaPX"],Marker:1,Invisible:1,ArmorItems:[{},{},{},{id:"magma",Count:1}],NoGravity:1}
execute @a[ry=-68,rym=-112] ~ ~ ~ detect ~0.5 ~ ~ magma 0 execute @s ~ ~ ~ detect ~2 ~ ~ air 0 execute @s ~ ~ ~ setblock ~1 ~ ~ air
execute @a[ry=112,rym=68] ~ ~ ~ detect ~-0.5 ~ ~ magma 0 execute @s ~ ~ ~ detect ~-2 ~ ~ air 0 execute @s ~ ~ ~ summon item_frame ~-1 ~ ~ {Tags:["tsPushMagmaSpawn"]}
execute @a[ry=112,rym=68] ~ ~ ~ detect ~-0.5 ~ ~ magma 0 execute @s ~ ~ ~ detect ~-2 ~ ~ air 0 execute @s ~ ~ ~ execute @e[tag=tsPushMagmaSpawn,c=1] ~ ~ ~ summon armor_stand ~ ~-0.5 ~0.475 {Tags:["tsPushMagma","tsPushMagmaNX"],Marker:1,Invisible:1,ArmorItems:[{},{},{},{id:"magma",Count:1}],NoGravity:1}
execute @a[ry=112,rym=68] ~ ~ ~ detect ~-0.5 ~ ~ magma 0 execute @s ~ ~ ~ detect ~-2 ~ ~ air 0 execute @s ~ ~ ~ setblock ~-1 ~ ~ air
execute @a[ry=22,rym=-22] ~ ~ ~ detect ~ ~ ~0.5 magma 0 execute @s ~ ~ ~ detect ~ ~ ~2 air 0 execute @s ~ ~ ~ summon item_frame ~ ~ ~1 {Tags:["tsPushMagmaSpawn"]}
execute @a[ry=22,rym=-22] ~ ~ ~ detect ~ ~ ~0.5 magma 0 execute @s ~ ~ ~ detect ~ ~ ~2 air 0 execute @s ~ ~ ~ execute @e[tag=tsPushMagmaSpawn,c=1] ~ ~ ~ summon armor_stand ~ ~-0.5 ~0.475 {Tags:["tsPushMagma","tsPushMagmaPZ"],Marker:1,Invisible:1,ArmorItems:[{},{},{},{id:"magma",Count:1}],NoGravity:1}
execute @a[ry=22,rym=-22] ~ ~ ~ detect ~ ~ ~0.5 magma 0 execute @s ~ ~ ~ detect ~ ~ ~2 air 0 execute @s ~ ~ ~ setblock ~ ~ ~1 air
execute @a[ry=-158,rym=158] ~ ~ ~ detect ~ ~ ~-0.5 magma 0 execute @s ~ ~ ~ detect ~ ~ ~-2 air 0 execute @s ~ ~ ~ summon item_frame ~ ~ ~-1 {Tags:["tsPushMagmaSpawn"]}
execute @a[ry=-158,rym=158] ~ ~ ~ detect ~ ~ ~-0.5 magma 0 execute @s ~ ~ ~ detect ~ ~ ~-2 air 0 execute @s ~ ~ ~ execute @e[tag=tsPushMagmaSpawn,c=1] ~ ~ ~ summon armor_stand ~ ~-0.5 ~0.475 {Tags:["tsPushMagma","tsPushMagmaNZ"],Marker:1,Invisible:1,ArmorItems:[{},{},{},{id:"magma",Count:1}],NoGravity:1}
execute @a[ry=-158,rym=158] ~ ~ ~ detect ~ ~ ~-0.5 magma 0 execute @s ~ ~ ~ detect ~ ~ ~-2 air 0 execute @s ~ ~ ~ setblock ~ ~ ~-1 air

kill @e[tag=tsPushMagmaSpawn]

scoreboard players tag @e[tag=tsPushMagmaContinue] remove tsPushMagmaContinue

execute @e[tag=tsPushMagmaPX] ~ ~ ~ detect ~0.6 ~ ~ air 0 scoreboard players tag @s add tsPushMagmaContinue
execute @e[tag=tsPushMagmaPX] ~ ~ ~ detect ~0.6 ~ ~ air 0 tp @s ~0.0625 ~ ~
execute @e[tag=tsPushMagmaNX] ~ ~ ~ detect ~-0.6 ~ ~ air 0  scoreboard players tag @s add tsPushMagmaContinue
execute @e[tag=tsPushMagmaNX] ~ ~ ~ detect ~-0.6 ~ ~ air 0 tp @s ~-0.0625 ~ ~
execute @e[tag=tsPushMagmaPZ] ~ ~ ~ detect ~ ~ ~0.575 air 0  scoreboard players tag @s add tsPushMagmaContinue
execute @e[tag=tsPushMagmaPZ] ~ ~ ~ detect ~ ~ ~0.575 air 0 tp @s ~ ~ ~0.0625
execute @e[tag=tsPushMagmaNZ] ~ ~ ~ detect ~ ~ ~-0.575 air 0  scoreboard players tag @s add tsPushMagmaContinue
execute @e[tag=tsPushMagmaNZ] ~ ~ ~ detect ~ ~ ~-0.575 air 0 tp @s ~ ~ ~-0.0625

execute @e[tag=tsPushMagma] ~ ~ ~ particle flame ~ ~0.5 ~ 0.1 0.1 0.1 0 2

scoreboard players add @e[tag=tsPushMagma] tsPush 1
scoreboard players tag @e[score_tsPush_min=16] remove tsPushMagmaContinue

execute @a ~ ~ ~ detect ~ ~ ~ magma * tp @s ~ ~1 ~

execute @e[tag=tsPushMagma] ~ ~ ~ execute @s[tag=!tsPushMagmaContinue] ~ ~ ~ detect ~ ~-1 ~ air * summon falling_block ~ ~ ~ {Block:"magma",Time:1}
execute @e[tag=tsPushMagma] ~ ~ ~ execute @s[tag=!tsPushMagmaContinue] ~ ~ ~ detect ~ ~-1 ~ air * particle lava ~ ~-1.5 ~ 0.3 0.3 0.3 0.1 25
execute @e[tag=tsPushMagma] ~ ~ ~ execute @s[tag=!tsPushMagmaContinue] ~ ~ ~ detect ~ ~-1 ~ air * kill @s

execute @e[tag=tsPushMagma] ~ ~ ~ execute @s[tag=!tsPushMagmaContinue] ~ ~ ~ setblock ~ ~ ~ magma 0
execute @e[tag=tsPushMagma] ~ ~ ~ execute @s[tag=!tsPushMagmaContinue] ~ ~ ~ particle lava ~ ~0.5 ~ 0.3 0.3 0.3 0.1 25
execute @e[tag=tsPushMagma] ~ ~ ~ execute @s[tag=!tsPushMagmaContinue] ~ ~ ~ kill @s
