Skip to content

Commit 0b930cc

Browse files
committed
feat(lobby): ✨ Added admin menu for jump timers
1 parent c4e2615 commit 0b930cc

40 files changed

Lines changed: 417 additions & 79 deletions

build/Switch_datapack.zip

6.76 KB
Binary file not shown.
6.81 KB
Binary file not shown.

build/datapack/data/switch/function/modes/snowball_painter/color/actionbar.mcfunction

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# @within switch:modes/snowball_painter/second [ as @a[tag=!detached,gamemode=adventure] ]
77
#
88

9-
## File attribut: Ignore translations
109
title @s[scores={switch.temp.color=0}] actionbar {"translate":"block.minecraft.orange_wool","color":"#ff8000"}
1110
title @s[scores={switch.temp.color=1}] actionbar {"translate":"block.minecraft.magenta_wool","color":"#ff8000"}
1211
title @s[scores={switch.temp.color=2}] actionbar {"translate":"block.minecraft.light_blue_wool","color":"#00ffff"}

build/datapack/data/switch/function/music/actions/repeat_all.mcfunction

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@
66
# @within switch:player/trigger/music/main
77
#
88

9-
## File attribut: Ignore translations
109
tellraw @s {"text":"Work in progress","color":"red"}
1110

build/datapack/data/switch/function/player/jump_timer/actionbar.mcfunction

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
# switch:player/jump_timer/finish
88
#
99

10-
## File attribut: Ignore translations
11-
1210
scoreboard players operation #jump_time switch.data = @s switch.jump_timer
1311
function switch:player/jump_timer/compute_display
1412
execute if score @s switch.jump_timer_id matches 1 run title @s actionbar [{"text":"","color":"gold"},{"text":"Green Jump","color":"green"},{"text":" : ","color":"gray"},{"score":{"name":"#secs","objective":"switch.data"},"color":"yellow"},{"text":".","color":"yellow"},{"score":{"name":"#d1","objective":"switch.data"},"color":"yellow"},{"score":{"name":"#d2","objective":"switch.data"},"color":"yellow"},{"text":"s","color":"yellow"}]
@@ -17,7 +15,7 @@ execute if score @s switch.jump_timer_id matches 3 run title @s actionbar [{"tex
1715
execute if score @s switch.jump_timer_id matches 4 run title @s actionbar [{"text":"","color":"gold"},{"text":"Yellow Jump","color":"yellow"},{"text":" : ","color":"gray"},{"score":{"name":"#secs","objective":"switch.data"},"color":"yellow"},{"text":".","color":"yellow"},{"score":{"name":"#d1","objective":"switch.data"},"color":"yellow"},{"score":{"name":"#d2","objective":"switch.data"},"color":"yellow"},{"text":"s","color":"yellow"}]
1816
execute if score @s switch.jump_timer_id matches 5 run title @s actionbar [{"text":"","color":"gold"},{"text":"Red Jump","color":"red"},{"text":" : ","color":"gray"},{"score":{"name":"#secs","objective":"switch.data"},"color":"yellow"},{"text":".","color":"yellow"},{"score":{"name":"#d1","objective":"switch.data"},"color":"yellow"},{"score":{"name":"#d2","objective":"switch.data"},"color":"yellow"},{"text":"s","color":"yellow"}]
1917
execute if score @s switch.jump_timer_id matches 6 run title @s actionbar [{"text":"","color":"gold"},{"text":"Brown Jump","color":"#8B4513"},{"text":" : ","color":"gray"},{"score":{"name":"#secs","objective":"switch.data"},"color":"yellow"},{"text":".","color":"yellow"},{"score":{"name":"#d1","objective":"switch.data"},"color":"yellow"},{"score":{"name":"#d2","objective":"switch.data"},"color":"yellow"},{"text":"s","color":"yellow"}]
20-
execute if score @s switch.jump_timer_id matches 7 run title @s actionbar [{"text":"","color":"gold"},{"text":"Purple Jump","color":"light_purple"},{"text":" : ","color":"gray"},{"score":{"name":"#secs","objective":"switch.data"},"color":"yellow"},{"text":".","color":"yellow"},{"score":{"name":"#d1","objective":"switch.data"},"color":"yellow"},{"score":{"name":"#d2","objective":"switch.data"},"color":"yellow"},{"text":"s","color":"yellow"}]
18+
execute if score @s switch.jump_timer_id matches 7 run title @s actionbar [{"text":"","color":"gold"},{"text":"Purple Jump","color":"dark_purple"},{"text":" : ","color":"gray"},{"score":{"name":"#secs","objective":"switch.data"},"color":"yellow"},{"text":".","color":"yellow"},{"score":{"name":"#d1","objective":"switch.data"},"color":"yellow"},{"score":{"name":"#d2","objective":"switch.data"},"color":"yellow"},{"text":"s","color":"yellow"}]
2119
execute if score @s switch.jump_timer_id matches 8 run title @s actionbar [{"text":"","color":"gold"},{"text":"Dripstone Jump","color":"gold"},{"text":" : ","color":"gray"},{"score":{"name":"#secs","objective":"switch.data"},"color":"yellow"},{"text":".","color":"yellow"},{"score":{"name":"#d1","objective":"switch.data"},"color":"yellow"},{"score":{"name":"#d2","objective":"switch.data"},"color":"yellow"},{"text":"s","color":"yellow"}]
2220
execute if score @s switch.jump_timer_id matches 9 run title @s actionbar [{"text":"","color":"gold"},{"text":"Pink Jump","color":"light_purple"},{"text":" : ","color":"gray"},{"score":{"name":"#secs","objective":"switch.data"},"color":"yellow"},{"text":".","color":"yellow"},{"score":{"name":"#d1","objective":"switch.data"},"color":"yellow"},{"score":{"name":"#d2","objective":"switch.data"},"color":"yellow"},{"text":"s","color":"yellow"}]
2321
execute if score @s switch.jump_timer_id matches 10 run title @s actionbar [{"text":"","color":"gold"},{"text":"Bricks Jump","color":"#BC4A3C"},{"text":" : ","color":"gray"},{"score":{"name":"#secs","objective":"switch.data"},"color":"yellow"},{"text":".","color":"yellow"},{"score":{"name":"#d1","objective":"switch.data"},"color":"yellow"},{"score":{"name":"#d2","objective":"switch.data"},"color":"yellow"},{"text":"s","color":"yellow"}]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
#> switch:player/jump_timer/admin/list
3+
#
4+
# @within switch:player/jump_timer/admin/menu {jump:\"green\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
5+
# switch:player/jump_timer/admin/menu {jump:\"white\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
6+
# switch:player/jump_timer/admin/menu {jump:\"blue\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
7+
# switch:player/jump_timer/admin/menu {jump:\"yellow\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
8+
# switch:player/jump_timer/admin/menu {jump:\"red\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
9+
# switch:player/jump_timer/admin/menu {jump:\"brown\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
10+
# switch:player/jump_timer/admin/menu {jump:\"purple\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
11+
# switch:player/jump_timer/admin/menu {jump:\"dripstone\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
12+
# switch:player/jump_timer/admin/menu {jump:\"pink\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
13+
# switch:player/jump_timer/admin/menu {jump:\"bricks\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
14+
# switch:player/jump_timer/admin/menu {jump:\"obsidian\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
15+
# switch:player/jump_timer/admin/menu {jump:\"duality\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
16+
# switch:player/jump_timer/admin/menu {jump:\"graviglitch\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
17+
# switch:player/jump_timer/admin/set_time {jump:"$(jump)"}
18+
# switch:player/jump_timer/admin/remove {jump:"$(jump)"}
19+
#
20+
# @args jump (unknown)
21+
#
22+
23+
$tellraw @s ["",{"text":"--- Best times: ","color":"gold"},{"text":"$(jump)","color":"yellow"},{"text":" ---","color":"gold"}]
24+
$data modify storage switch:temp jt_admin set from storage switch:jumps $(jump)
25+
scoreboard players set #admin_rank switch.data 0
26+
$data modify storage switch:temp jt_admin_input set value {jump:"$(jump)"}
27+
execute if data storage switch:temp jt_admin[0] run function switch:player/jump_timer/admin/list_loop
28+
$execute unless data storage switch:jumps $(jump)[0] run tellraw @s [{"text":"(no recorded time)","color":"gray","italic":true}]
29+
30+
# Suggest adding a player manually and going back to the jumps menu
31+
$tellraw @s ["",{"text":"[+ Add a time]","color":"green","click_event":{"action":"suggest_command","command":"/function switch:player/jump_timer/admin/set_time {jump:\"$(jump)\",name:\"Steve\",time:1000}"},"hover_event":{"action":"show_text","value":{"text":"Add/edit a player time (in centiseconds: 1000 = 10s)","color":"gray"}}},{"text":" "},{"text":"[⬅ Back]","color":"gold","click_event":{"action":"run_command","command":"/function switch:player/jump_timer/admin/menu"}}]
32+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
#> switch:player/jump_timer/admin/list_line
3+
#
4+
# @within switch:player/jump_timer/admin/list_loop with storage switch:temp jt_admin_input
5+
#
6+
# @args name (unknown)
7+
# display (unknown)
8+
# jump (unknown)
9+
# time (unknown)
10+
#
11+
12+
$tellraw @s ["",{"text":"#","color":"gold"},{"score":{"name":"#admin_rank","objective":"switch.data"},"color":"gold"},{"text":" $(name)","color":"yellow"},{"text":" ($(display))","color":"aqua"},{"text":" [✏]","color":"gold","click_event":{"action":"suggest_command","command":"/function switch:player/jump_timer/admin/set_time {jump:\"$(jump)\",name:\"$(name)\",time:$(time)}"},"hover_event":{"action":"show_text","value":{"text":"Edit this time (in centiseconds: 1000 = 10s)","color":"gray"}}},{"text":" [❌]","color":"red","click_event":{"action":"run_command","command":"/function switch:player/jump_timer/admin/remove {jump:\"$(jump)\",name:\"$(name)\"}"},"hover_event":{"action":"show_text","value":{"text":"Remove this time","color":"gray"}}}]
13+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
#> switch:player/jump_timer/admin/list_loop
3+
#
4+
# @within switch:player/jump_timer/admin/list
5+
# switch:player/jump_timer/admin/list_loop
6+
#
7+
8+
scoreboard players add #admin_rank switch.data 1
9+
data modify storage switch:temp jt_admin_input.name set from storage switch:temp jt_admin[0].name
10+
data modify storage switch:temp jt_admin_input.time set from storage switch:temp jt_admin[0].time
11+
data modify storage switch:temp jt_admin_input.display set from storage switch:temp jt_admin[0].display
12+
function switch:player/jump_timer/admin/list_line with storage switch:temp jt_admin_input
13+
data remove storage switch:temp jt_admin[0]
14+
execute if data storage switch:temp jt_admin[0] run function switch:player/jump_timer/admin/list_loop
15+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
#> switch:player/jump_timer/admin/menu
3+
#
4+
# @within switch:player/jump_timer/admin/list {jump:\"$(jump)\",name:\"Steve\",time:1000}"},"hover_event":{"action":"show_text","value":{"text":"Add/edit a player time (in centiseconds: 1000 = 10s)","color":"gray"}}},{"text":" "},{"text":"[⬅ Back]","color":"gold","click_event":{"action":"run_command","command":"/function switch:player/jump_timer/admin/menu"}}]
5+
#
6+
7+
tellraw @s [{"text":"--- Jump leaderboards (admin) ---","color":"gold","bold":true}]
8+
tellraw @s ["",{"text":"","color":"gold"},{"text":"[Green Jump]","color":"green","click_event":{"action":"run_command","command":"/function switch:player/jump_timer/admin/list {jump:\"green\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
9+
tellraw @s ["",{"text":"","color":"gold"},{"text":"[White Jump]","color":"white","click_event":{"action":"run_command","command":"/function switch:player/jump_timer/admin/list {jump:\"white\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
10+
tellraw @s ["",{"text":"","color":"gold"},{"text":"[Blue Jump]","color":"blue","click_event":{"action":"run_command","command":"/function switch:player/jump_timer/admin/list {jump:\"blue\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
11+
tellraw @s ["",{"text":"","color":"gold"},{"text":"[Yellow Jump]","color":"yellow","click_event":{"action":"run_command","command":"/function switch:player/jump_timer/admin/list {jump:\"yellow\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
12+
tellraw @s ["",{"text":"","color":"gold"},{"text":"[Red Jump]","color":"red","click_event":{"action":"run_command","command":"/function switch:player/jump_timer/admin/list {jump:\"red\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
13+
tellraw @s ["",{"text":"","color":"gold"},{"text":"[Brown Jump]","color":"#8B4513","click_event":{"action":"run_command","command":"/function switch:player/jump_timer/admin/list {jump:\"brown\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
14+
tellraw @s ["",{"text":"","color":"gold"},{"text":"[Purple Jump]","color":"dark_purple","click_event":{"action":"run_command","command":"/function switch:player/jump_timer/admin/list {jump:\"purple\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
15+
tellraw @s ["",{"text":"","color":"gold"},{"text":"[Dripstone Jump]","color":"gold","click_event":{"action":"run_command","command":"/function switch:player/jump_timer/admin/list {jump:\"dripstone\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
16+
tellraw @s ["",{"text":"","color":"gold"},{"text":"[Pink Jump]","color":"light_purple","click_event":{"action":"run_command","command":"/function switch:player/jump_timer/admin/list {jump:\"pink\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
17+
tellraw @s ["",{"text":"","color":"gold"},{"text":"[Bricks Jump]","color":"#BC4A3C","click_event":{"action":"run_command","command":"/function switch:player/jump_timer/admin/list {jump:\"bricks\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
18+
tellraw @s ["",{"text":"","color":"gold"},{"text":"[Obsidian Jump]","color":"dark_gray","click_event":{"action":"run_command","command":"/function switch:player/jump_timer/admin/list {jump:\"obsidian\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
19+
tellraw @s ["",{"text":"","color":"gold"},{"text":"[Duality Jump]","color":"#B87333","click_event":{"action":"run_command","command":"/function switch:player/jump_timer/admin/list {jump:\"duality\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
20+
tellraw @s ["",{"text":"","color":"gold"},{"text":"[GraviGlitch Jump]","color":"#676767","click_event":{"action":"run_command","command":"/function switch:player/jump_timer/admin/list {jump:\"graviglitch\"}"},"hover_event":{"action":"show_text","value":{"text":"Show the recorded times of this jump","color":"gray"}}}]
21+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
#> switch:player/jump_timer/admin/remove
3+
#
4+
# @within switch:player/jump_timer/admin/list_line {jump:\"$(jump)\",name:\"$(name)\",time:$(time)}"},"hover_event":{"action":"show_text","value":{"text":"Edit this time (in centiseconds: 1000 = 10s)","color":"gray"}}},{"text":" [❌]","color":"red","click_event":{"action":"run_command","command":"/function switch:player/jump_timer/admin/remove {jump:\"$(jump)\",name:\"$(name)\"}"},"hover_event":{"action":"show_text","value":{"text":"Remove this time","color":"gray"}}}]
5+
#
6+
# @args jump (unknown)
7+
# name (unknown)
8+
#
9+
10+
$execute unless data storage switch:jumps $(jump)[{name:"$(name)"}] run return run tellraw @s [{"text":"No time found for $(name) on this jump.","color":"red"}]
11+
$data remove storage switch:jumps $(jump)[{name:"$(name)"}]
12+
$execute as @e[type=text_display,tag=switch.stat_display,tag=jump_$(jump)] run kill @s
13+
$tellraw @s ["",{"text":"Removed ","color":"green"},{"text":"$(name)","color":"yellow"},{"text":" from this jump leaderboard.","color":"green"}]
14+
$function switch:player/jump_timer/admin/list {jump:"$(jump)"}
15+

0 commit comments

Comments
 (0)