scoreboard players add @s[tag=nitHellShip,tag=nitID_match] nitHellAttacks 1
scoreboard players add @s[tag=nitHellFactory,tag=nitID_match] nitHellAttacks 1
scoreboard players add @s[tag=nitHellDrill,tag=nitID_match] nitHellAttacks 1

###Class 1 attack, occurs on first, second, and third structures###
execute if entity @s[scores={nitHellAttacks=1},tag=nitHellShip] at @e[tag=nitHellSpawn,distance=..20] run summon minecraft:wither_skeleton ~ ~ ~ {HandItems:[{id:"minecraft:iron_sword",Count:1b},{id:"minecraft:shield",Count:1b}],CustomName:'{"text":"Tyrant\'s Soldier"}',CustomNameVisible:0b,PersistenceRequired:1b,CanPickUpLoot:1b,Tags:[nitEntity,nitTyrantEntity,smithed.entity],DeathLootTable:"nitk:entities/tyrant_soldier"}
execute if entity @s[scores={nitHellAttacks=1},tag=nitHellShip] run effect give @e[type=wither_skeleton,distance=..20] minecraft:glowing 999999
execute if entity @s[scores={nitHellAttacks=1},tag=nitHellShip] run summon minecraft:lightning_bolt ~2 ~ ~2

execute if entity @s[scores={nitHellAttacks=2},tag=nitHellShip] at @e[tag=nitHellSpawn,distance=..20] run summon minecraft:wither_skeleton ~ ~ ~ {HandItems:[{id:"minecraft:iron_sword",Count:1b},{id:"minecraft:shield",Count:1b}],CustomName:'{"text":"Tyrant\'s Soldier"}',CustomNameVisible:0b,PersistenceRequired:1b,CanPickUpLoot:1b,Tags:[nitEntity,nitTyrantEntity,smithed.entity],DeathLootTable:"nitk:entities/tyrant_soldier"}
effect give @e[type=wither_skeleton,distance=..20] minecraft:glowing 999999
execute if entity @s[scores={nitHellAttacks=2},tag=nitHellShip] run summon minecraft:lightning_bolt ~2 ~ ~2

execute if entity @s[scores={nitHellAttacks=3},tag=nitHellShip] at @e[tag=nitHellSpawn,distance=..20] run summon minecraft:wither_skeleton ~ ~ ~ {HandItems:[{id:"minecraft:iron_sword",Count:1b},{id:"minecraft:shield",Count:1b}],CustomName:'{"text":"Tyrant\'s Soldier"}',CustomNameVisible:0b,PersistenceRequired:1b,CanPickUpLoot:1b,Tags:[nitEntity,nitTyrantEntity,smithed.entity],DeathLootTable:"nitk:entities/tyrant_soldier"}
execute if entity @s[scores={nitHellAttacks=3},tag=nitHellShip] at @e[tag=nitHellSpawn,distance=..20] run summon minecraft:wither_skeleton ~ ~ ~ {HandItems:[{id:"minecraft:iron_sword",Count:1b},{id:"minecraft:shield",Count:1b}],CustomName:'{"text":"Tyrant\'s Soldier"}',CustomNameVisible:0b,PersistenceRequired:1b,CanPickUpLoot:1b,Tags:[nitEntity,nitTyrantEntity,smithed.entity],DeathLootTable:"nitk:entities/tyrant_soldier"}
execute if entity @s[scores={nitHellAttacks=3},tag=nitHellShip] run effect give @e[type=wither_skeleton,distance=..20] minecraft:glowing 999999
execute if entity @s[scores={nitHellAttacks=3},tag=nitHellShip] run summon minecraft:lightning_bolt ~2 ~ ~2

###Class 2 attack, occurs on fifth and sixth structures###
execute if entity @s[scores={nitHellAttacks=5},tag=nitHellFactory] at @e[tag=nitHellSpawn,distance=..20] run summon minecraft:blaze ~ ~ ~ {HandItems:[{id:"minecraft:iron_sword",Count:1b},{id:"minecraft:shield",Count:1b}],CustomName:'{"text":"Tyrant\'s Guard"}',CustomNameVisible:0b,PersistenceRequired:1b,CanPickUpLoot:1b,Tags:[nitEntity,nitTyrantEntity,smithed.entity],DeathLootTable:"nitk:entities/tyrant_ranger"}
execute if entity @s[scores={nitHellAttacks=5},tag=nitHellFactory] run effect give @e[type=blaze,distance=..20] minecraft:glowing 999999
execute if entity @s[scores={nitHellAttacks=5},tag=nitHellFactory] run summon minecraft:lightning_bolt ~2 ~ ~2

execute if entity @s[scores={nitHellAttacks=6},tag=nitHellFactory] at @e[tag=nitHellSpawn,distance=..20] run summon minecraft:blaze ~ ~ ~ {HandItems:[{id:"minecraft:iron_sword",Count:1b},{id:"minecraft:shield",Count:1b}],CustomName:'{"text":"Tyrant\'s Ranger"}',CustomNameVisible:0b,PersistenceRequired:1b,CanPickUpLoot:1b,Tags:[nitEntity,nitTyrantEntity,smithed.entity],DeathLootTable:"nitk:entities/tyrant_ranger"}
execute if entity @s[scores={nitHellAttacks=6},tag=nitHellFactory] at @e[tag=nitHellSpawn,distance=..20] run summon minecraft:wither_skeleton ~ ~ ~ {HandItems:[{id:"minecraft:iron_sword",Count:1b},{id:"minecraft:shield",Count:1b}],CustomName:'{"text":"Tyrant\'s Soldier"}',CustomNameVisible:0b,PersistenceRequired:1b,CanPickUpLoot:1b,Tags:[nitEntity,nitTyrantEntity,smithed.entity],DeathLootTable:"nitk:entities/tyrant_soldier"}
execute if entity @s[scores={nitHellAttacks=6},tag=nitHellFactory] run effect give @e[type=wither_skeleton,distance=..20] minecraft:glowing 999999
execute if entity @s[scores={nitHellAttacks=6},tag=nitHellFactory] run effect give @e[type=blaze,distance=..20] minecraft:glowing 999999
execute if entity @s[scores={nitHellAttacks=6},tag=nitHellFactory] run summon minecraft:lightning_bolt ~2 ~ ~2

###Class 3 attack, occurs on ninth structure###
execute if entity @s[scores={nitHellAttacks=9},tag=nitHellDrill] at @e[tag=nitHellSpawn,distance=..20] run summon minecraft:blaze ~ ~ ~ {HandItems:[{id:"minecraft:iron_sword",Count:1b},{id:"minecraft:shield",Count:1b}],CustomName:'{"text":"Tyrant\'s Ranger"}',CustomNameVisible:0b,PersistenceRequired:1b,CanPickUpLoot:1b,Tags:[nitEntity,nitTyrantEntity,smithed.entity],DeathLootTable:"nitk:entities/tyrant_ranger"}
execute if entity @s[scores={nitHellAttacks=9},tag=nitHellDrill] at @e[tag=nitHellSpawn,distance=..20] run summon minecraft:wither_skeleton ~ ~ ~ {HandItems:[{id:"minecraft:iron_sword",Count:1b},{id:"minecraft:shield",Count:1b}],CustomName:'{"text":"Tyrant\'s Soldier"}',CustomNameVisible:0b,PersistenceRequired:1b,CanPickUpLoot:1b,Tags:[nitEntity,nitTyrantEntity,smithed.entity],DeathLootTable:"nitk:entities/tyrant_soldier"}
execute if entity @s[scores={nitHellAttacks=9},tag=nitHellDrill] at @e[tag=nitHellSpawn,distance=..20] run summon minecraft:magma_cube ~ ~ ~ {Size:2,HandItems:[{id:"minecraft:iron_sword",Count:1b},{id:"minecraft:shield",Count:1b}],CustomName:'{"text":"Tyrant\'s Cavalry"}',CustomNameVisible:0b,PersistenceRequired:1b,CanPickUpLoot:1b,Tags:[nitEntity,nitTyrantEntity,smithed.entity],DeathLootTable:"nitk:entities/tyrant_cavalry"}
execute if entity @s[scores={nitHellAttacks=9},tag=nitHellDrill] run effect give @e[type=wither_skeleton,distance=..20] minecraft:glowing 999999
execute if entity @s[scores={nitHellAttacks=9},tag=nitHellDrill] run effect give @e[type=blaze,distance=..20] minecraft:glowing 999999
execute if entity @s[scores={nitHellAttacks=9},tag=nitHellDrill] run effect give @e[type=magma_cube,distance=..20] minecraft:glowing 999999
execute if entity @s[scores={nitHellAttacks=9},tag=nitHellDrill] run summon minecraft:lightning_bolt ~2 ~ ~2


tag @s remove nitID_match