###Builds the upgrade###
place template nitk:upgrades/industrial_farm ~-7 ~ ~-7

###Moves and Promotes the Farmer###
tp @e[tag=nitFarmhand,limit=1,sort=nearest] @e[tag=nitFarmerSpot,limit=1,sort=nearest]
data modify entity @e[tag=nitFarmhand,limit=1,sort=nearest] CustomName set value '{"text":"Farm Operator"}'

###Farmer setup###
execute at @e[tag=nitResourceChest,distance=..20] run setblock ~ ~ ~ chest[facing=north]
tag @e[type=minecraft:villager,distance=..20] add nitCitizen
scoreboard players operation @e[tag=nitCitizen,distance=..20] nitID = @e[tag=nitKTP,limit=1,sort=nearest] nitID

###Cleanup###
function nitk:siteplanner/upgrades/cleanup