From d897fe7d8f499672f8d6eec658e32a5afce81a46 Mon Sep 17 00:00:00 2001 From: Vincent Foriel Date: Sat, 11 Nov 2023 18:38:19 +0100 Subject: [PATCH] Prevent being killed by worldborder when a player is in the tutorial --- .../functions/player/death/trigger.mcfunction | 10 +++++----- .../functions/tutorial/leave.mcfunction | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/trigger.mcfunction b/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/trigger.mcfunction index c2e9076a..4d20eab2 100644 --- a/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/trigger.mcfunction +++ b/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/trigger.mcfunction @@ -6,15 +6,15 @@ execute as @a at @s run spawnpoint @s ~ ~ ~ ~ # Exit world border ----------------------------------------------------------- #check X -execute unless score #game.loading data matches 1 as @a[tag=!player.is_dead,gamemode=!spectator] if score @s pos.x > WBbyTwo data run kill @s -execute unless score #game.loading data matches 1 as @a[tag=!player.is_dead,gamemode=!spectator] if score @s pos.x < -WBbyTwo data run kill @s +execute unless entity @a[tag=inTutorial] unless score #game.loading data matches 1 as @a[tag=!player.is_dead,gamemode=!spectator] if score @s pos.x > WBbyTwo data run kill @s +execute unless entity @a[tag=inTutorial] unless score #game.loading data matches 1 as @a[tag=!player.is_dead,gamemode=!spectator] if score @s pos.x < -WBbyTwo data run kill @s #check Y -execute unless score #game.loading data matches 1 as @a[tag=!player.is_dead,gamemode=!spectator] if score @s pos.y < 0 const run kill @s +execute unless entity @a[tag=inTutorial] unless score #game.loading data matches 1 as @a[tag=!player.is_dead,gamemode=!spectator] if score @s pos.y < 0 const run kill @s #check Z -execute unless score #game.loading data matches 1 as @a[tag=!player.is_dead,gamemode=!spectator] if score @s pos.z > WBbyTwo data run kill @s -execute unless score #game.loading data matches 1 as @a[tag=!player.is_dead,gamemode=!spectator] if score @s pos.z < -WBbyTwo data run kill @s +execute unless entity @a[tag=inTutorial] unless score #game.loading data matches 1 as @a[tag=!player.is_dead,gamemode=!spectator] if score @s pos.z > WBbyTwo data run kill @s +execute unless entity @a[tag=inTutorial] unless score #game.loading data matches 1 as @a[tag=!player.is_dead,gamemode=!spectator] if score @s pos.z < -WBbyTwo data run kill @s # Check if player can respawn ------------------------------------------------- diff --git a/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/tutorial/leave.mcfunction b/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/tutorial/leave.mcfunction index 10a9ab38..ab2780d6 100644 --- a/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/tutorial/leave.mcfunction +++ b/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/tutorial/leave.mcfunction @@ -5,6 +5,10 @@ execute as @e[type=marker,tag=TutorialCellClear] at @s run function scaffolding_ function scaffolding_rush:player/join/lobby +scoreboard players set @s pos.x 0 +scoreboard players set @s pos.y 24 +scoreboard players set @s pos.z 0 + tag @s remove TutorialMessage1 tag @s remove TutorialMessage2 tag @s remove TutorialMessage3