Skip to content

Commit

Permalink
Prevent being killed by worldborder when a player is in the tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
VForiel committed Nov 11, 2023
1 parent e2bedfb commit d897fe7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 -------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d897fe7

Please sign in to comment.