Skip to content

Commit

Permalink
Try moving it to functions #PleaseWork2
Browse files Browse the repository at this point in the history
  • Loading branch information
DinnerBeef committed Oct 28, 2023
1 parent 78a8a4a commit a8058a5
Show file tree
Hide file tree
Showing 26 changed files with 35 additions and 33 deletions.
11 changes: 2 additions & 9 deletions data/lt/authority_behaviors/golf_area.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
{
"enter_commands": [
"function lt:game/minigolf/core/hole_end",
"execute as @s run function lt:game/minigolf/core/golf_leave",
"tag @s add in.golf.area",
"execute if score GolfMode golf.global matches 1 run disguise as tropicraft:fiddler_crab",
"execute if score GolfMode golf.global matches 1 run tag @s add golf.is.crab"
"function lt:game/minigolf/core/enter_area"
],
"exit_commands": [
"execute as @s run function lt:game/minigolf/core/golf_leave",
"tag @s remove in.golf.area",
"execute if entity @s[tag=golf.is.crab] run disguise clear",
"tag @s remove golf.is.crab"
"function lt:game/minigolf/core/leave_area"
]
}
5 changes: 5 additions & 0 deletions data/lt/functions/game/minigolf/core/enter_area.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function lt:game/minigolf/core/hole_end
execute as @s run function lt:game/minigolf/core/golf_leave
tag @s add in.golf.area
execute if score GolfMode golf.global matches 1 run disguise as tropicraft:fiddler_crab
execute if score GolfMode golf.global matches 1 run tag @s add golf.is.crab
4 changes: 4 additions & 0 deletions data/lt/functions/game/minigolf/core/leave_area.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
execute as @s run function lt:game/minigolf/core/golf_leave
tag @s remove in.golf.area
execute if entity @s[tag=golf.is.crab] run disguise clear
tag @s remove golf.is.crab
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ execute at @a[tag=hole01Player] run kill @e[type=minecraft:experience_orb,distan
## Run when the player runs out of time
title @a[tag=hole01Player,tag=hole01Timeup] actionbar [{"translate":"lt.golf.time_up_part_1","color":"red"}, {"text":"#1","color":"red"}, {"translate":"lt.golf.time_up_part_2","color":"red"}]
## Runs when the players gets into the hole
title @a[tag=hole01Player,tag=!hole01Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole01Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]]
title @a[tag=hole01Player,tag=!hole01Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole01Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]
execute as @a[tag=hole01Player,tag=!hole01Timeup] at @e[tag=hole01End] run function lt:game/minigolf/core/firework
# Sets the player high score to the scoreboard
execute unless score hole01Hits golf.global > @p[tag=hole01Player,tag=!hole01Timeup] golf.01.scores run scoreboard players operation @a[tag=hole01Player] golf.01.scores = hole01Hits golf.global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ execute at @a[tag=hole02Player] run kill @e[type=minecraft:experience_orb,distan
## Run when the player runs out of time
title @a[tag=hole02Player,tag=hole02Timeup] actionbar [{"translate":"lt.golf.time_up_part_1","color":"red"}, {"text":"#1","color":"red"}, {"translate":"lt.golf.time_up_part_2","color":"red"}]
## Runs when the players gets into the hole
title @a[tag=hole02Player,tag=!hole02Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole02Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]]
title @a[tag=hole02Player,tag=!hole02Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole02Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]
execute as @a[tag=hole02Player,tag=!hole02Timeup] at @e[tag=hole02End] run function lt:game/minigolf/core/firework
# Sets the player high score to the scoreboard
execute unless score hole02Hits golf.global > @p[tag=hole02Player,tag=!hole02Timeup] golf.02.scores run scoreboard players operation @a[tag=hole02Player] golf.02.scores = hole02Hits golf.global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ execute at @a[tag=hole03Player] run kill @e[type=minecraft:experience_orb,distan
## Run when the player runs out of time
title @a[tag=hole03Player,tag=hole03Timeup] actionbar [{"translate":"lt.golf.time_up_part_1","color":"red"}, {"text":"#1","color":"red"}, {"translate":"lt.golf.time_up_part_2","color":"red"}]
## Runs when the players gets into the hole
title @a[tag=hole03Player,tag=!hole03Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole03Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]]
title @a[tag=hole03Player,tag=!hole03Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole03Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]
execute as @a[tag=hole03Player,tag=!hole03Timeup] at @e[tag=hole03End] run function lt:game/minigolf/core/firework
# Sets the player high score to the scoreboard
execute unless score hole03Hits golf.global > @p[tag=hole03Player,tag=!hole03Timeup] golf.03.scores run scoreboard players operation @a[tag=hole03Player] golf.03.scores = hole03Hits golf.global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ execute at @a[tag=hole04Player] run kill @e[type=minecraft:experience_orb,distan
## Run when the player runs out of time
title @a[tag=hole04Player,tag=hole04Timeup] actionbar [{"translate":"lt.golf.time_up_part_1","color":"red"}, {"text":"#1","color":"red"}, {"translate":"lt.golf.time_up_part_2","color":"red"}]
## Runs when the players gets into the hole
title @a[tag=hole04Player,tag=!hole04Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole04Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]]
title @a[tag=hole04Player,tag=!hole04Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole04Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]
execute as @a[tag=hole04Player,tag=!hole04Timeup] at @e[tag=hole04End] run function lt:game/minigolf/core/firework
# Sets the player high score to the scoreboard
execute unless score hole04Hits golf.global > @p[tag=hole04Player,tag=!hole04Timeup] golf.04.scores run scoreboard players operation @a[tag=hole04Player] golf.04.scores = hole04Hits golf.global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ execute at @a[tag=hole05Player] run kill @e[type=minecraft:experience_orb,distan
## Run when the player runs out of time
title @a[tag=hole05Player,tag=hole05Timeup] actionbar [{"translate":"lt.golf.time_up_part_1","color":"red"}, {"text":"#1","color":"red"}, {"translate":"lt.golf.time_up_part_2","color":"red"}]
## Runs when the players gets into the hole
title @a[tag=hole05Player,tag=!hole05Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole05Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]]
title @a[tag=hole05Player,tag=!hole05Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole05Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]
execute as @a[tag=hole05Player,tag=!hole05Timeup] at @e[tag=hole05End] run function lt:game/minigolf/core/firework
# Sets the player high score to the scoreboard
execute unless score hole05Hits golf.global > @p[tag=hole05Player,tag=!hole05Timeup] golf.05.scores run scoreboard players operation @a[tag=hole05Player] golf.05.scores = hole05Hits golf.global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ execute at @a[tag=hole06Player] run kill @e[type=minecraft:experience_orb,distan
## Run when the player runs out of time
title @a[tag=hole06Player,tag=hole06Timeup] actionbar [{"translate":"lt.golf.time_up_part_1","color":"red"}, {"text":"#1","color":"red"}, {"translate":"lt.golf.time_up_part_2","color":"red"}]
## Runs when the players gets into the hole
title @a[tag=hole06Player,tag=!hole06Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole06Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]]
title @a[tag=hole06Player,tag=!hole06Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole06Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]
execute as @a[tag=hole06Player,tag=!hole06Timeup] at @e[tag=hole06End] run function lt:game/minigolf/core/firework
# Sets the player high score to the scoreboard
execute unless score hole06Hits golf.global > @p[tag=hole06Player,tag=!hole06Timeup] golf.06.scores run scoreboard players operation @a[tag=hole06Player] golf.06.scores = hole06Hits golf.global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ execute at @a[tag=hole07Player] run kill @e[type=minecraft:experience_orb,distan
## Run when the player runs out of time
title @a[tag=hole07Player,tag=hole07Timeup] actionbar [{"translate":"lt.golf.time_up_part_1","color":"red"}, {"text":"#1","color":"red"}, {"translate":"lt.golf.time_up_part_2","color":"red"}]
## Runs when the players gets into the hole
title @a[tag=hole07Player,tag=!hole07Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole07Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]]
title @a[tag=hole07Player,tag=!hole07Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole07Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]
execute as @a[tag=hole07Player,tag=!hole07Timeup] at @e[tag=hole07End] run function lt:game/minigolf/core/firework
# Sets the player high score to the scoreboard
execute unless score hole07Hits golf.global > @p[tag=hole07Player,tag=!hole07Timeup] golf.07.scores run scoreboard players operation @a[tag=hole07Player] golf.07.scores = hole07Hits golf.global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ execute at @a[tag=hole08Player] run kill @e[type=minecraft:experience_orb,distan
## Run when the player runs out of time
title @a[tag=hole08Player,tag=hole08Timeup] actionbar [{"translate":"lt.golf.time_up_part_1","color":"red"}, {"text":"#1","color":"red"}, {"translate":"lt.golf.time_up_part_2","color":"red"}]
## Runs when the players gets into the hole
title @a[tag=hole08Player,tag=!hole08Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole08Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]]
title @a[tag=hole08Player,tag=!hole08Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole08Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]
execute as @a[tag=hole08Player,tag=!hole08Timeup] at @e[tag=hole08End] run function lt:game/minigolf/core/firework
# Sets the player high score to the scoreboard
execute unless score hole08Hits golf.global > @p[tag=hole08Player,tag=!hole08Timeup] golf.08.scores run scoreboard players operation @a[tag=hole08Player] golf.08.scores = hole08Hits golf.global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ execute at @a[tag=hole09Player] run kill @e[type=minecraft:experience_orb,distan
## Run when the player runs out of time
title @a[tag=hole09Player,tag=hole09Timeup] actionbar [{"translate":"lt.golf.time_up_part_1","color":"red"}, {"text":"#1","color":"red"}, {"translate":"lt.golf.time_up_part_2","color":"red"}]
## Runs when the players gets into the hole
title @a[tag=hole09Player,tag=!hole09Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole09Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]]
title @a[tag=hole09Player,tag=!hole09Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole09Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]
execute as @a[tag=hole09Player,tag=!hole09Timeup] at @e[tag=hole09End] run function lt:game/minigolf/core/firework
# Sets the player high score to the scoreboard
execute unless score hole09Hits golf.global > @p[tag=hole09Player,tag=!hole09Timeup] golf.09.scores run scoreboard players operation @a[tag=hole09Player] golf.09.scores = hole09Hits golf.global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ execute at @a[tag=hole10Player] run kill @e[type=minecraft:experience_orb,distan
## Run when the player runs out of time
title @a[tag=hole10Player,tag=hole10Timeup] actionbar [{"translate":"lt.golf.time_up_part_1","color":"red"}, {"text":"#1","color":"red"}, {"translate":"lt.golf.time_up_part_2","color":"red"}]
## Runs when the players gets into the hole
title @a[tag=hole10Player,tag=!hole10Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole10Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]]
title @a[tag=hole10Player,tag=!hole10Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole10Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]
execute as @a[tag=hole10Player,tag=!hole10Timeup] at @e[tag=hole10End] run function lt:game/minigolf/core/firework
# Sets the player high score to the scoreboard
execute unless score hole10Hits golf.global > @p[tag=hole10Player,tag=!hole10Timeup] golf.10.scores run scoreboard players operation @a[tag=hole10Player] golf.10.scores = hole10Hits golf.global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ execute at @a[tag=hole11Player] run kill @e[type=minecraft:experience_orb,distan
## Run when the player runs out of time
title @a[tag=hole11Player,tag=hole11Timeup] actionbar [{"translate":"lt.golf.time_up_part_1","color":"red"}, {"text":"#1","color":"red"}, {"translate":"lt.golf.time_up_part_2","color":"red"}]
## Runs when the players gets into the hole
title @a[tag=hole11Player,tag=!hole11Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole11Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]]
title @a[tag=hole11Player,tag=!hole11Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole11Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]
execute as @a[tag=hole11Player,tag=!hole11Timeup] at @e[tag=hole11End] run function lt:game/minigolf/core/firework
# Sets the player high score to the scoreboard
execute unless score hole11Hits golf.global > @p[tag=hole11Player,tag=!hole11Timeup] golf.11.scores run scoreboard players operation @a[tag=hole11Player] golf.11.scores = hole11Hits golf.global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ execute at @a[tag=hole12Player] run kill @e[type=minecraft:experience_orb,distan
## Run when the player runs out of time
title @a[tag=hole12Player,tag=hole12Timeup] actionbar [{"translate":"lt.golf.time_up_part_1","color":"red"}, {"text":"#1","color":"red"}, {"translate":"lt.golf.time_up_part_2","color":"red"}]
## Runs when the players gets into the hole
title @a[tag=hole12Player,tag=!hole12Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole12Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]]
title @a[tag=hole12Player,tag=!hole12Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole12Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]
execute as @a[tag=hole12Player,tag=!hole12Timeup] at @e[tag=hole12End] run function lt:game/minigolf/core/firework
# Sets the player high score to the scoreboard
execute unless score hole12Hits golf.global > @p[tag=hole12Player,tag=!hole12Timeup] golf.12.scores run scoreboard players operation @a[tag=hole12Player] golf.12.scores = hole12Hits golf.global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ execute at @a[tag=hole13Player] run kill @e[type=minecraft:experience_orb,distan
## Run when the player runs out of time
title @a[tag=hole13Player,tag=hole13Timeup] actionbar [{"translate":"lt.golf.time_up_part_1","color":"red"}, {"text":"#1","color":"red"}, {"translate":"lt.golf.time_up_part_2","color":"red"}]
## Runs when the players gets into the hole
title @a[tag=hole13Player,tag=!hole13Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole13Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]]
title @a[tag=hole13Player,tag=!hole13Timeup] actionbar [{"translate":"lt.golf.end_hole_part_1","color":"red"},{"text":"#1","color":"red"},{"translate":"lt.golf.end_hole_part_2","color":"red"},{"score":{"name":"hole13Hits","objective":"golf.global"},"color":"green"},{"translate":"lt.golf.end_hole_part_3","color":"red"}]
execute as @a[tag=hole13Player,tag=!hole13Timeup] at @e[tag=hole13End] run function lt:game/minigolf/core/firework
# Sets the player high score to the scoreboard
execute unless score hole13Hits golf.global > @p[tag=hole13Player,tag=!hole13Timeup] golf.13.scores run scoreboard players operation @a[tag=hole13Player] golf.13.scores = hole13Hits golf.global
Expand Down
Loading

0 comments on commit a8058a5

Please sign in to comment.