###Builds the drill station###
tp @s ~ ~1 ~
execute at @s run place template nitref:invasion/drill_station ~-14 ~ ~-9

###Summons hostile mobs###
execute at @s run summon skeleton ~-5 ~13 ~-1 {PersistenceRequired:1,HandItems:[{Count:1,id:bow,tag:{Enchantments:[{id:flame,lvl:1},{id:infinity,lvl:1}]}},{}],CustomName:'{"text":"Tyrant\'s Invader"}',HandDropChances:[1.0f,0.0f],ArmorDropChances:[0.0f,0.0f,0.0f,0.0f],Tags:[nitEntity,smithed.entity],ActiveEffects:[{Id:12,Amplifier:0,Duration:999999}]}
execute at @s run summon skeleton ~-5 ~13 ~1 {PersistenceRequired:1,HandItems:[{Count:1,id:bow,tag:{Enchantments:[{id:flame,lvl:1},{id:infinity,lvl:1}]}},{}],CustomName:'{"text":"Tyrant\'s Invader"}',HandDropChances:[1.0f,0.0f],ArmorDropChances:[0.0f,0.0f,0.0f,0.0f],Tags:[nitEntity,smithed.entity],ActiveEffects:[{Id:12,Amplifier:0,Duration:999999}]}
execute at @s run summon wither_skeleton ~-5 ~13 ~ {PersistenceRequired:1,HandItems:[{Count:1,id:netherite_sword,tag:{Enchantments:[{id:fire_aspect,lvl:1}]}},{}],CustomName:'{"text":"Tyrant\'s General"}',Tags:[smithed.entity,smithed.strict,nitInvadeGeneral,nitEntity],DeathLootTable:"nitk:entities/tyrant_general"}

###Progress the invasion score and performs cosmetics###
scoreboard players add @a[predicate=nitref:end_dimension] nitInvadeProg 1
summon minecraft:lightning_bolt

tellraw @a[predicate=nitref:end_dimension] [{"text":"[۩]","color":"green","bold":true},{"text":": ","color":"white","bold":false},{"text":"The Tyrant has sent a new drilling station!","color":"dark_red"}]