# © Spark Universe, 2023
# authors: destruc7i0n
# description: spawn the zombies for p1
# called by: 

execute positioned ~ ~ ~-6 run summon spark:zombie_basic_holo ~ ~ ~ facing @p[tag=instance_player] spark:tutorial_slow
execute positioned ~ ~ ~-6 as @e[type=spark:zombie_basic_holo,c=1] run tag @s add p1_spawn
execute positioned ~ ~ ~6 run summon spark:zombie_basic_holo ~ ~ ~ facing @p[tag=instance_player] spark:tutorial_slow
execute positioned ~ ~ ~6 as @e[type=spark:zombie_basic_holo,c=1] run tag @s add p1_spawn
execute positioned ~6 ~ ~ run summon spark:zombie_basic_holo ~ ~ ~ facing @p[tag=instance_player] spark:tutorial_slow
execute positioned ~6 ~ ~ as @e[type=spark:zombie_basic_holo,c=1] run tag @s add p1_spawn
execute positioned ~-6 ~ ~ run summon spark:zombie_basic_holo ~ ~ ~ facing @p[tag=instance_player] spark:tutorial_slow
execute positioned ~-6 ~ ~ as @e[type=spark:zombie_basic_holo,c=1] run tag @s add p1_spawn

# set the player id for the zombies for the instance
execute as @e[tag=p1_spawn] run scoreboard players operation @s tut = .tut_player_id player_id
give @p[tag=instance_player] spark:baseball_bat 1 0 {"minecraft:item_lock": {"mode": "lock_in_slot"}, "minecraft:keep_on_death": {}}

tag @e[tag=p1_spawn] add tutorial_target
tag @e[tag=p1_spawn] remove p1_spawn
