execute at @s positioned ~ ~ ~ run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2

execute at @s positioned ~2 ~ ~2 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~2 ~ ~1 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~2 ~ ~ run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~2 ~ ~-1 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~2 ~ ~-2 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2

execute at @s positioned ~1 ~ ~2 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~1 ~ ~1 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~1 ~ ~ run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~1 ~ ~-1 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~1 ~ ~-2 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2

execute at @s positioned ~ ~ ~2 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~ ~ ~1 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~ ~ ~ run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~ ~ ~-1 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~ ~ ~-2 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2

execute at @s positioned ~-1 ~ ~2 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~-1 ~ ~1 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~-1 ~ ~ run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~-1 ~ ~-1 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~-1 ~ ~-2 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2

execute at @s positioned ~-2 ~ ~2 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~-2 ~ ~1 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~-2 ~ ~ run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~-2 ~ ~-1 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2
execute at @s positioned ~-2 ~ ~-2 run execute unless block ~ -62 ~ barrier run function zzzzdonotuse:nethercorruption/corruptionredux2

tag @s add CorruptionBegan
#scoreboard players remove @s NetherQ 10000

setblock ~ 319 ~ minecraft:structure_block[mode=load]{name:"suhc:nethercorruptionmarkers",posX:-1,posZ:-1,posY:-1,rotation:NONE,mirror:NONE,mode:LOAD,ignoreEntities:0b} destroy
setblock ~ 318 ~ redstone_block
setblock ~ 318 ~ air
setblock ~ 319 ~ air

#move the markers down to the portal's Y level
execute at @s positioned ~ 320 ~ run execute store result score @e[type=marker,distance=..3,tag=KyuNetherCorrupt] PosY run data get entity @s Pos[1]
execute at @s positioned ~ 320 ~ run execute as @e[type=marker,distance=..3,tag=KyuNetherCorrupt] run execute store result entity @s Pos[1] double 1 run scoreboard players get @s PosY
