# © Spark Universe, 2023
# authors: destruc7i0n
# description: spawn the pets for the player to choose from
# called by: 

# spawn the pets
execute positioned ~1 ~0 ~6 run setblock ~ ~ ~ mud_brick_slab
execute positioned ~1 ~0.5 ~6 run summon spark:german_shepherd ~ ~ ~ facing @p[tag=instance_player]
execute positioned ~1 ~0.5 ~6 as @e[type=spark:german_shepherd,c=1] run tag @s add pet_spawn

execute positioned ~3 ~0 ~6 run setblock ~ ~ ~ mud_brick_slab
execute positioned ~3 ~0.5 ~6 run summon spark:rottweiler ~ ~ ~ facing @p[tag=instance_player]
execute positioned ~3 ~0.5 ~6 as @e[type=spark:rottweiler,c=1] run tag @s add pet_spawn

execute positioned ~-1 ~0 ~6 run setblock ~ ~ ~ mud_brick_slab
execute positioned ~-1 ~0.5 ~6 run summon spark:boxer_robot ~ ~ ~ facing @p[tag=instance_player]
execute positioned ~-1 ~0.5 ~6 as @e[type=spark:boxer_robot,c=1] run tag @s add pet_spawn

execute positioned ~-3 ~0 ~6 run setblock ~ ~ ~ mud_brick_slab
execute positioned ~-3 ~0.5 ~6 run summon spark:battery_robot ~ ~ ~ facing @p[tag=instance_player]
execute positioned ~-3 ~0.5 ~6 as @e[type=spark:battery_robot,c=1] run tag @s add pet_spawn

# assign them to this instance
execute as @e[tag=pet_spawn] run scoreboard players operation @s tut = @p[tag=instance_player] player_id
give @p[tag=instance_player] spark:collar 1 0 {"minecraft:item_lock": {"mode": "lock_in_slot"}, "minecraft:keep_on_death": {}}

tag @e[tag=pet_spawn] add tutorial_pet
tag @e[tag=pet_spawn] remove pet_spawn
