From 0e7a275aac1c432688c0d17573f210071a6848b4 Mon Sep 17 00:00:00 2001 From: Maciek Fraczek <54240096+Nik0-0@users.noreply.github.com> Date: Wed, 28 Feb 2024 13:28:43 +0000 Subject: [PATCH] DP | BugFixing #2 --- .../data/nnb_spawnsystem/functions/call_bots.mcfunction | 3 ++- .../data/nnb_spawnsystem/functions/setup_bots.mcfunction | 1 - nnb_spawnsystem/main.jmc | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/nnb_spawnsystem/data/nnb_spawnsystem/functions/call_bots.mcfunction b/nnb_spawnsystem/data/nnb_spawnsystem/functions/call_bots.mcfunction index e5b9bf2..3baecc5 100644 --- a/nnb_spawnsystem/data/nnb_spawnsystem/functions/call_bots.mcfunction +++ b/nnb_spawnsystem/data/nnb_spawnsystem/functions/call_bots.mcfunction @@ -3,4 +3,5 @@ execute store result storage nnb_spawnsystem:temp id int 1 run scoreboard player execute store result storage nnb_spawnsystem:temp limit int 1 run scoreboard players get random_r nn_spawn execute store result storage nnb_spawnsystem:__storage__ switch_key int 1 run scoreboard players get spawn nn_spawn function nnb_spawnsystem:__private__/switch_case/1/select with storage nnb_spawnsystem:__storage__ -function nnb_spawnsystem:setup_bots with storage nnb_spawnsystem:temp \ No newline at end of file +scoreboard players add ticks nn_spawn 1 +execute if score ticks nn_spawn matches 6.. run function nnb_spawnsystem:setup_bots with storage nnb_spawnsystem:temp \ No newline at end of file diff --git a/nnb_spawnsystem/data/nnb_spawnsystem/functions/setup_bots.mcfunction b/nnb_spawnsystem/data/nnb_spawnsystem/functions/setup_bots.mcfunction index 6c1fd3f..8d93505 100644 --- a/nnb_spawnsystem/data/nnb_spawnsystem/functions/setup_bots.mcfunction +++ b/nnb_spawnsystem/data/nnb_spawnsystem/functions/setup_bots.mcfunction @@ -1,4 +1,3 @@ execute if score spawn nn_spawn matches 29 run scoreboard players set spawn nn_spawn 0 -scoreboard players add ticks nn_spawn 1 $execute unless entity @e[tag=$(bot_name)] run scoreboard players set spawn nn_nextbot_spawn $(id) execute if score ticks nn_spawn matches 11.. run function nnb_spawnsystem:tp_bots with storage nnb_spawnsystem:temp \ No newline at end of file diff --git a/nnb_spawnsystem/main.jmc b/nnb_spawnsystem/main.jmc index 5a8deec..3df9ccd 100644 --- a/nnb_spawnsystem/main.jmc +++ b/nnb_spawnsystem/main.jmc @@ -224,8 +224,10 @@ function call_bots() { data modify storage nnb_spawnsystem:temp bot_name set value "anim8or"; } // Call the universal spawn bot function -setup_bots() with storage nnb_spawnsystem:temp; -} +scoreboard players add ticks nn_spawn 1; +if (nn_spawn:ticks > 5) { + setup_bots() with storage nnb_spawnsystem:temp; +}} // Universal spawn bot stuff function setup_bots() { @@ -234,7 +236,7 @@ function setup_bots() { scoreboard players set spawn nn_spawn 0; } - scoreboard players add ticks nn_spawn 1; + $execute unless entity @e[tag=$(bot_name)] run scoreboard players set spawn nn_nextbot_spawn $(id);