#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#
#    This function has been created by Skilendarz Group.
#             https://skilendarz.com
#
#      GIVE MAP MAKERS THE CREDIT THEY DESERVE!
#             COPYING IS PROHIBITED!
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

#Spawn
summon marker 315 106 -354 {Tags:["floor_af"]}
execute at @e[tag=floor_af] run summon marker ~1 ~ ~ {Tags:["floor_af"]}
execute at @e[tag=floor_af] run summon marker ~2 ~ ~ {Tags:["floor_af"]}
execute at @e[tag=floor_af,limit=2] run summon marker ~4 ~ ~ {Tags:["floor_af"]}
tag @e[tag=floor_af,limit=3] add floor_af_left
tag @e[tag=floor_af,tag=!floor_af_left] add floor_af_right

execute at @e[tag=floor_af_left] run summon marker ~ ~ ~1 {Tags:["floor_af","floor_af_left"]}
execute at @e[tag=floor_af_left] run summon marker ~ ~ ~2 {Tags:["floor_af","floor_af_left"]}
execute at @e[tag=floor_af_left] run summon marker ~ ~ ~4 {Tags:["floor_af","floor_af_left"]}
execute at @e[tag=floor_af_right] run summon marker ~ ~ ~1 {Tags:["floor_af","floor_af_right"]}
execute at @e[tag=floor_af_right] run summon marker ~ ~ ~2 {Tags:["floor_af","floor_af_right"]}
execute at @e[tag=floor_af_right] run summon marker ~ ~ ~4 {Tags:["floor_af","floor_af_right"]}

execute at @e[tag=floor_af] if block ~ ~ ~ oak_planks if block ~ ~-1 ~ air run summon armor_stand ~ ~-0.01 ~ {Tags:["floor_as","floor"],Invisible:1,NoGravity:1,Marker:1,Passengers:[{id:"falling_block",NoGravity:1,Time:-32000,Tags:["floor_block","floor"],BlockState:{Name:"oak_planks"}},{id:"shulker",NoAI:1,Silent:1,Invulnerable:1,Tags:["floor"]}]}
execute at @e[tag=floor_af] if block ~ ~ ~ spruce_planks if block ~ ~-1 ~ air run summon armor_stand ~ ~-0.01 ~ {Tags:["floor_as","floor"],Invisible:1,NoGravity:1,Marker:1,Passengers:[{id:"falling_block",NoGravity:1,Time:-32000,Tags:["floor_block","floor"],BlockState:{Name:"spruce_planks"}},{id:"shulker",NoAI:1,Silent:1,Invulnerable:1,Tags:["floor"]}]}
execute at @e[tag=floor_af_left] run tag @e[tag=floor_as,limit=1,sort=nearest,distance=..0.1] add floor_as_left
execute at @e[tag=floor_af_right] run tag @e[tag=floor_as,limit=1,sort=nearest,distance=..0.1] add floor_as_right
effect give @e[type=minecraft:shulker] minecraft:invisibility 1000000 100 true

kill @e[tag=floor_af]
fill 317 106 -354 319 106 -349 air
fill 320 106 -351 318 106 -348 air
fill 315 106 -350 316 106 -352 air