From 4dbb5c20b92018411527c08ced431a0b1a9764f1 Mon Sep 17 00:00:00 2001 From: _Nik0__ Date: Wed, 28 Feb 2024 00:48:54 +0100 Subject: [PATCH] DP | Fix teleportation bug --- .../data/nnb_spawnsystem/functions/setup_bots.mcfunction | 3 ++- nnb_spawnsystem/main.jmc | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nnb_spawnsystem/data/nnb_spawnsystem/functions/setup_bots.mcfunction b/nnb_spawnsystem/data/nnb_spawnsystem/functions/setup_bots.mcfunction index 6078e04..258ec4a 100644 --- a/nnb_spawnsystem/data/nnb_spawnsystem/functions/setup_bots.mcfunction +++ b/nnb_spawnsystem/data/nnb_spawnsystem/functions/setup_bots.mcfunction @@ -1,5 +1,6 @@ scoreboard players remove 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 <= 0 nn_spawn run tp @e[tag=$(bot_name)_z] @e[tag=$(map),limit=1,sort=random] +$execute if score ticks nn_spawn <= 0 nn_spawn run tp @e[tag=$(bot_name)_z,tag=!done] @e[tag=$(map),limit=1,sort=random] +$execute if score ticks nn_spawn <= 0 nn_spawn run tag @e[tag=$(bot_name)_z,tag=!done] add done $execute if score ticks nn_spawn <= 0 nn_spawn run tellraw @a[tag=debug] "$(bot_name) $(id) $(map)" execute if score ticks nn_spawn <= 0 nn_spawn run scoreboard players set ticks nn_spawn 20 \ No newline at end of file diff --git a/nnb_spawnsystem/main.jmc b/nnb_spawnsystem/main.jmc index 37bdbb3..0f7e22b 100644 --- a/nnb_spawnsystem/main.jmc +++ b/nnb_spawnsystem/main.jmc @@ -164,7 +164,8 @@ function setup_bots() { scoreboard players remove 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 <= 0 nn_spawn run tp @e[tag=$(bot_name)_z] @e[tag=$(map),limit=1,sort=random]; + $execute if score ticks nn_spawn <= 0 nn_spawn run tp @e[tag=$(bot_name)_z,tag=!done] @e[tag=$(map),limit=1,sort=random]; + $execute if score ticks nn_spawn <= 0 nn_spawn run tag @e[tag=$(bot_name)_z,tag=!done] add done; $execute if score ticks nn_spawn <= 0 nn_spawn run tellraw @a[tag=debug] "$(bot_name) $(id) $(map)"; execute if score ticks nn_spawn <= 0 nn_spawn run scoreboard players set ticks nn_spawn 20;