Skip to content

Commit

Permalink
Started Fixing Minigolf
Browse files Browse the repository at this point in the history
  • Loading branch information
DinnerBeef committed Oct 7, 2024
1 parent 4d22dfb commit 5a5ef88
Show file tree
Hide file tree
Showing 72 changed files with 39 additions and 171 deletions.
23 changes: 0 additions & 23 deletions data/lt/function/game/minigolf/core/42.mcfunction

This file was deleted.

2 changes: 0 additions & 2 deletions data/lt/function/game/minigolf/core/collectible.mcfunction

This file was deleted.

19 changes: 0 additions & 19 deletions data/lt/function/game/minigolf/core/played_all_holes.mcfunction

This file was deleted.

6 changes: 0 additions & 6 deletions data/lt/function/game/minigolf/holes/hole_01/start.mcfunction

This file was deleted.

15 changes: 0 additions & 15 deletions data/lt/function/game/minigolf/holes/hole_01/start_hole.mcfunction

This file was deleted.

14 changes: 0 additions & 14 deletions data/lt/function/game/minigolf/holes/hole_01/timer.mcfunction

This file was deleted.

9 changes: 0 additions & 9 deletions data/lt/function/game/minigolf/milestones/hole_19.mcfunction

This file was deleted.

9 changes: 0 additions & 9 deletions data/lt/function/game/minigolf/milestones/hole_20.mcfunction

This file was deleted.

9 changes: 0 additions & 9 deletions data/lt/function/game/minigolf/milestones/hole_21.mcfunction

This file was deleted.

8 changes: 0 additions & 8 deletions data/lt/function/game/minigolf/milestones/hole_22.mcfunction

This file was deleted.

13 changes: 0 additions & 13 deletions data/lt/function/game/minigolf/milestones/hole_23.mcfunction

This file was deleted.

43 changes: 0 additions & 43 deletions data/lt/function/game/minigolf/milestones/reset.mcfunction

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ give @s stone_hoe{display:{Name:'{"translate":"lt.golf.gentle_putter","color":"l
give @s golden_hoe{display:{Name:'{"translate":"lt.golf.soft_putter","color":"light_purple","italic":false}',Lore:['{"translate":"lt.golf.soft_putter.info","color":"white"}']},HideFlags:127,Unbreakable:1b,Enchantments:[{id:"minecraft:knockback",lvl:2s}],Tags:[golf],undroppable:true} 1
give @s iron_hoe{display:{Name:'{"translate":"lt.golf.putter","color":"light_purple","italic":false}',Lore:['{"translate":"lt.golf.putter.info","color":"white"}']},HideFlags:127,Unbreakable:1b,Enchantments:[{id:"minecraft:knockback",lvl:3s}],Tags:[golf],undroppable:true} 1
give @s diamond_hoe{display:{Name:'{"translate":"lt.golf.powerful_driver","color":"light_purple","italic":false}',Lore:['{"translate":"lt.golf.powerful_driver.info","color":"white"}']},HideFlags:127,Unbreakable:1b,Enchantments:[{id:"minecraft:knockback",lvl:4s}],Tags:[golf],undroppable:true} 1
give @s netherite_hoe{display:{Name:'{"translate":"lt.golf.potent_driver","color":"light_purple","italic":false}',Lore:['{"translate":"lt.golf.potent_driver.info","color":"white"}']},HideFlags:127,Unbreakable:1b,Enchantments:[{id:"minecraft:knockback",lvl:5s}],Tags:[golf],undroppable:true} 1
give @s netherite_hoe{display:{Name:'{"translate":"lt.golf.potent_driver","color":"light_purple","italic":false}',Lore:['{"translate":"lt.golf.potent_driver.info","color":"white"}']},HideFlags:127,Unbreakable:1b,Enchantments:[{id:"minecraft:knockback",lvl:5s}],Tags:[golf],undroppable:true} 1


give DinnerBeef minecraft:stone_hoe[custom_name='{"translate":"lt.golf.gentle_putter","color":"light_purple","italic":false}',lore=['{"translate":"lt.golf.gentle_putter.info","color":"white"}'],ltextras:undroppable={},hide_additional_tooltip={},minecraft:custom_data={lt:golf},unbreakable={},enchantments={levels:{knockback:1},show_in_tooltip:false}]
6 changes: 6 additions & 0 deletions data/lt/function/world_games/minigolf/holes/start.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Stop Them form playing if all ready playing a hole
execute if entity @s[tag=golfInGame] run function lt:game/minigolf/core/in_hole
# Sends a message if someone else is palying
$execute if entity @s[tag=!golfInGame] if entity @a[tag=hole$(hole_number)Player,current_world=true] run title @p[tag=!hole$(hole_number)Player] actionbar ["",{"selector":"@p[tag=hole$(hole_number)Player]"},{"translate":"lt.golf.in_use","color":"#ED8754"}]
# Start hole if no one else is playing
$execute if entity @s[tag=!golfInGame] unless entity @a[tag=hole$(hole_number)Player,current_world=true] run function lt:world_games/minigolf/holes/start_hole {"hole_number": $(hole_number)}
15 changes: 15 additions & 0 deletions data/lt/function/world_games/minigolf/holes/start_hole.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$scoreboard players set hole$(hole_number)Hits golf.global 0
$scoreboard players set hole$(hole_number)EndCounter golf.global 0
$scoreboard players operation hole$(hole_number)Timer golf.global = maxTime golf.global
# Give player tag showing what hole they are on
$tag @s add hole$(hole_number)Player
# Makes creavite players go to survival
function lt:world_games/minigolf/core/hole_start
# Summon the crab an tags it
$execute at @e[tag=hole$(hole_number)Start] run function lt:world_games/minigolf/core/summon_crab
$execute at @e[tag=hole$(hole_number)Start] run tag @e[tag=golfCrab,distance=..5] add hole$(hole_number)Crab
# Gives the player the putters
# Starts the round of golf
$function lt:world_games/minigolf/holes/timer {"hole_number": $(hole_number)}
scoreboard players add total_holes_played golf.global 1
$scoreboard players add $(hole_number)_total_times_played golf.global 1
14 changes: 14 additions & 0 deletions data/lt/function/world_games/minigolf/holes/timer.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Removes 1 Second
$scoreboard players remove hole$(hole_number)Timer golf.global 1
# Shows Time and Hits to the Player
$title @p[tag=hole01Player] actionbar [{"translate":"lt.golf.seconds_left","color":"dark_gray"},{"score":{"name":"hole$(hole_number)Timer","objective":"golf.global"},"color":"yellow"},{"text":" | "},{"translate":"lt.golf.hits","color":"dark_gray"},{"score":{"name":"hole$(hole_number)Hits","objective":"golf.global"},"color":"green"}]
# Tests if carb is near the hole
$execute as @e[tag=hole$(hole_number)Crab] at @s if entity @e[tag=hole$(hole_number)End,distance=..0.65] run scoreboard players add hole$(hole_number)EndCounter golf.global 1
$execute as @e[tag=hole$(hole_number)Crab] at @s if entity @e[tag=hole$(hole_number)End,distance=0.65..] unless entity @e[tag=hole$(hole_number)End,distance=..0.65] run scoreboard players set hole$(hole_number)EndCounter golf.global 0
# Runs this function until out of time or the carb in the near hole for 2 seconds
$execute as @e[tag=hole$(hole_number)Crab] unless score hole$(hole_number)EndCounter golf.global matches 2 run schedule lt:world_games/minigolf/holes/timer {"hole_number": $(hole_number)}
# Runs if player ran out of time
$execute if score hole$(hole_number)Timer golf.global matches 0 run tag @a[tag=hole$(hole_number)Player] add hole$(hole_number)Timeup
execute if score hole$(hole_number)Timer golf.global matches 0 run function lt:world_games/minigolf/holes/end_hole
# Runs if crab is in the hole for 2 seconds
$execute if score hole$(hole_number)EndCounter golf.global matches 2 run function lt:world_games/minigolf/holes/end_hole

0 comments on commit 5a5ef88

Please sign in to comment.