diff --git a/nnb_spawnsystem/data/nnb_spawnsystem/functions/setup_bots.mcfunction b/nnb_spawnsystem/data/nnb_spawnsystem/functions/setup_bots.mcfunction index a3fd418..046dbac 100644 --- a/nnb_spawnsystem/data/nnb_spawnsystem/functions/setup_bots.mcfunction +++ b/nnb_spawnsystem/data/nnb_spawnsystem/functions/setup_bots.mcfunction @@ -1,5 +1,5 @@ +scoreboard players set ticks nn_spawn 20 $say $(bot_name) $(id) $(map) $execute unless entity @e[tag=$(bot_name)] run scoreboard players set spawn nn_nextbot_spawn $(id) -$tp @e[tag=$(bot_name)_z,tag=!done] @e[tag=$(map),limit=1,sort=random] -$tag @e[tag=$(bot_name)_z,tag=!done] add done -schedule function nnb_spawnsystem:map_detect 30t \ No newline at end of file +$tp @e[tag=$(bot_name)_z] @e[tag=$(map),limit=1,sort=random] +execute if score ticks nn_spawn <= 0 nn_lobby run function nnb_spawnsystem:map_detect \ No newline at end of file diff --git a/nnb_spawnsystem/main.jmc b/nnb_spawnsystem/main.jmc index 84e8642..33ccd42 100644 --- a/nnb_spawnsystem/main.jmc +++ b/nnb_spawnsystem/main.jmc @@ -174,11 +174,15 @@ function call_bots() { // Universal spawn bot stuff function setup_bots() { + scoreboard players set ticks nn_spawn 20; + $say "$(bot_name) $(id) $(map)"; $execute unless entity @e[tag=$(bot_name)] run scoreboard players set spawn nn_nextbot_spawn $(id); - $tp @e[tag=$(bot_name)_z,tag=!done] @e[tag=$(map),limit=1,sort=random]; - $tag @e[tag=$(bot_name)_z,tag=!done] add done; -schedule function map_detect() 30t; + $tp @e[tag=$(bot_name)_z] @e[tag=$(map),limit=1,sort=random]; + + if (nn_spawn:ticks <= nn_lobby:0) { + map_detect(); + } }