###################################################################################################### *** PHASE 13 - PALE GARDEN *** ######################################################################################################



# Portal_in creation #

execute unless block 0 65 0 minecraft:end_gateway run tellraw @a {"text":"A portal has appeared !","italic":true,"color":"yellow"}
execute unless block 0 65 0 minecraft:end_gateway run playsound minecraft:entity.illusioner.cast_spell block @a 0 66 0
execute run fill 0 65 0 0 66 0 minecraft:end_gateway
execute run setblock 0 64 0 minecraft:bedrock



# Teleportation_in #

execute as @a at @s in minecraft:overworld if predicate simply_oneblock:portal run time set midnight
execute as @a at @s in minecraft:overworld if predicate simply_oneblock:portal run execute in simply_oneblock:phase_13 run tp @s 0 80 0



# Dungeon set #

execute as @a in simply_oneblock:phase_13 run execute if block 0 76 0 minecraft:air run place template simply_oneblock:phase_13_1 -1 70 -15
execute as @a in simply_oneblock:phase_13 run execute if block 35 76 0 minecraft:air run place template simply_oneblock:phase_13_2 30 70 -15



# Portal_out creation #

execute in simply_oneblock:phase_13 unless block 3 78 0 minecraft:end_gateway if block 9 77 0 minecraft:pale_moss_carpet if block 44 79 0 minecraft:air if block 45 81 1 minecraft:air if block 46 82 0 minecraft:air if block 46 79 -1 minecraft:air if block 45 78 -2 minecraft:air run tellraw @a {"text":"A vault has appeared !","italic":true,"color":"yellow"}

execute in simply_oneblock:phase_13 unless block 3 78 0 minecraft:end_gateway if block 9 77 0 minecraft:pale_moss_carpet if block 44 79 0 minecraft:air if block 45 81 1 minecraft:air if block 46 82 0 minecraft:air if block 46 79 -1 minecraft:air if block 45 78 -2 minecraft:air run playsound minecraft:entity.illusioner.cast_spell block @a 9 77 0

execute in simply_oneblock:phase_13 unless block 3 78 0 minecraft:end_gateway if block 9 77 0 minecraft:pale_moss_carpet if block 44 79 0 minecraft:air if block 45 81 1 minecraft:air if block 46 82 0 minecraft:air if block 46 79 -1 minecraft:air if block 45 78 -2 minecraft:air run setblock 9 77 0 minecraft:vault[facing=south]{config: {key_item: {components: {"minecraft:custom_name": "Trophy_Key"}, count: 1, id: "minecraft:trial_key"}, loot_table: "simply_oneblock:pale_trophy"}}



execute in simply_oneblock:phase_13 unless block 3 78 0 minecraft:end_gateway if block 9 77 0 minecraft:vault{server_data:{total_ejections_needed: 1}} run tellraw @a {"text":"A portal has appeared !","italic":true,"color":"yellow"}

execute in simply_oneblock:phase_13 unless block 3 78 0 minecraft:end_gateway if block 9 77 0 minecraft:vault{server_data:{total_ejections_needed: 1}} run playsound minecraft:entity.illusioner.cast_spell block @a 19 77 12

execute in simply_oneblock:phase_13 unless block 3 78 0 minecraft:end_gateway if block 9 77 0 minecraft:vault{server_data:{total_ejections_needed: 1}} run fill 3 78 0 3 79 0 minecraft:end_gateway



# Teleportation_back #

execute as @a at @s in simply_oneblock:phase_13 if predicate simply_oneblock:portal if score fake_player ib_minedcount matches 5500 run execute in minecraft:overworld run fill 0 64 0 0 66 0 minecraft:air


