
execute unless entity @s[predicate=nitref:end_dimension] run tellraw @s [{"text":"[۩]","color":"green","bold":true},{"text":": ","color":"white","bold":false},{"text":"The Endermen need a new home in their own dimension!","color":"white","bold":false}]
execute if entity @s[predicate=nitref:end_dimension,y=90,dy=255] run tellraw @s [{"text":"[۩]","color":"green","bold":true},{"text":": ","color":"white","bold":false},{"text":"You are too high to start a tower. You must build lower!","color":"white","bold":false}]
execute positioned 0 50 0 if entity @s[distance=..70] run tag @s add nitTooClose
tellraw @a[tag=nitTooClose] [{"text":"[۩]","color":"green","bold":true},{"text":": ","color":"white","bold":false},{"text":"You cannot build so close to the dragon's lair. Venture out farther!","color":"white","bold":false}]
execute if entity @e[tag=nitRCP,distance=..500] run tellraw @s [{"text":"[۩]","color":"green","bold":true},{"text":": ","color":"white","bold":false},{"text":"You cannot build so close to another city. Venture out farther!","color":"white","bold":false}]
execute if entity @s[predicate=nitref:end_dimension,y=0,dy=89,tag=!nitTooClose] unless entity @e[tag=nitRCP,distance=..500] run tellraw @s [{"text":"[۩]","color":"green","bold":true},{"text":": ","color":"white","bold":false},{"text":"You begin to establish a refugee site...","color":"white","bold":false}]
execute if entity @s[predicate=nitref:end_dimension,y=0,dy=89,tag=!nitTooClose] unless entity @e[tag=nitRCP,distance=..500] run function nitref:contract
tag @s remove nitTooClose
scoreboard players set @s nitContract 0
execute if entity @e[tag=nitRCP,distance=..20] run gamerule sendCommandFeedback true