diff --git a/data/fz/advancements/login.json b/data/fz/advancements/login.json new file mode 100644 index 0000000..c427ede --- /dev/null +++ b/data/fz/advancements/login.json @@ -0,0 +1,12 @@ +{ + "criteria": { + "login": { + "trigger": "tick", + "conditions": { + "player": { + "" + } + } + } + } +} \ No newline at end of file diff --git a/data/fz/functions/event/install.mcfunction b/data/fz/functions/event/install.mcfunction new file mode 100644 index 0000000..22c251d --- /dev/null +++ b/data/fz/functions/event/install.mcfunction @@ -0,0 +1 @@ +scoreboard objectives add fz.event.leave_game minecraft.custom:leave_game \ No newline at end of file diff --git a/data/fz/functions/event/on_login.mcfunction b/data/fz/functions/event/on_login.mcfunction new file mode 100644 index 0000000..f3aa2bc --- /dev/null +++ b/data/fz/functions/event/on_login.mcfunction @@ -0,0 +1,4 @@ +function #fz:event/on_login + +scoreboard players reset @s fz.event.leave_game +advancement revoke @s only fz:login \ No newline at end of file diff --git a/data/fz/functions/event/uninstall.mcfunction b/data/fz/functions/event/uninstall.mcfunction new file mode 100644 index 0000000..7694c00 --- /dev/null +++ b/data/fz/functions/event/uninstall.mcfunction @@ -0,0 +1 @@ +scoreboard objectives remove fz.event.leave_game \ No newline at end of file diff --git a/data/fz/functions/module/config/buttons.mcfunction b/data/fz/functions/module/config/buttons.mcfunction deleted file mode 100644 index e69de29..0000000 diff --git a/data/fz/functions/module/config/install.mcfunction b/data/fz/functions/module/config/install.mcfunction index 5caef59..131e83d 100644 --- a/data/fz/functions/module/config/install.mcfunction +++ b/data/fz/functions/module/config/install.mcfunction @@ -1 +1 @@ -scoreboard objectives add fz.module.config.trigger \ No newline at end of file +scoreboard objectives add fz.module.config.trigger dummy \ No newline at end of file diff --git a/data/fz/functions/module/config/on_click.mcfunction b/data/fz/functions/module/config/on_click.mcfunction index 121e964..c3f4812 100644 --- a/data/fz/functions/module/config/on_click.mcfunction +++ b/data/fz/functions/module/config/on_click.mcfunction @@ -1,7 +1,9 @@ # 调用者:#fz:module/config/on_click ##### 处理玩家点击事件,并进行下一步操作 +execute if score @s fz.module.config.trigger matches 1000..1099 run function #fz:module/scoreboard/config/on_click +## 重置玩家的触发器分数 ## 重新显示一次按钮 -function #fz:module/config/buttons \ No newline at end of file +function #fz:module/config/display \ No newline at end of file diff --git a/data/fz/functions/module/config/trigger.mcfunction b/data/fz/functions/module/config/trigger.mcfunction index 7bff35e..39c73b2 100644 --- a/data/fz/functions/module/config/trigger.mcfunction +++ b/data/fz/functions/module/config/trigger.mcfunction @@ -1,11 +1,11 @@ -# 调用者:#fz:module/config/on_trigger +# 调用者:#fz:module/config/trigger ##### 玩家抬头到最高角度并蹲起后,触发此函数 ## 监听计分板分数的循环,schedule是为了避免1tick内执行两次,但可有可无 schedule function fz:module/config/loop 0t replace ## 显示按钮 -function #fz:module/config/buttons +function #fz:module/config/display ## 设置或重制超时时间 schedule function #fz:module/config/timeout 300s replace \ No newline at end of file diff --git a/data/fz/functions/module/config/uninstall.mcfunction b/data/fz/functions/module/config/uninstall.mcfunction index e69de29..012c45d 100644 --- a/data/fz/functions/module/config/uninstall.mcfunction +++ b/data/fz/functions/module/config/uninstall.mcfunction @@ -0,0 +1,3 @@ +schedule clear fz:module/config/loop + +scoreboard objectives remove fz.module.config.trigger \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/config/display/buttons.mcfunction b/data/fz/functions/module/scoreboard/config/display/buttons.mcfunction new file mode 100644 index 0000000..a1ba100 --- /dev/null +++ b/data/fz/functions/module/scoreboard/config/display/buttons.mcfunction @@ -0,0 +1,3 @@ +# 调用者:#fz:module/scoreboard/config/display/buttons + +tellraw @s [{"text": "- "}, {"text": "[关]", "color": "dark_red", "hoverEvent": {"action": "show_text", "contents": {"text": "关", "color": "dark_red"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1000"}}, {"text": "[总榜]", "color": "dark_aqua", "hoverEvent": {"action": "show_text", "contents": {"text": "总榜", "color": "dark_aqua"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1001"}}] \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/config/display/head.mcfunction b/data/fz/functions/module/scoreboard/config/display/head.mcfunction new file mode 100644 index 0000000..8ba1f65 --- /dev/null +++ b/data/fz/functions/module/scoreboard/config/display/head.mcfunction @@ -0,0 +1,3 @@ +# 调用者:#fz:module/scoreboard/config/display/head + +tellraw @s {"text": "计分板:"} \ No newline at end of file diff --git a/data/fz/tags/functions/module/config/buttons.json b/data/fz/tags/functions/event/on_login.json similarity index 53% rename from data/fz/tags/functions/module/config/buttons.json rename to data/fz/tags/functions/event/on_login.json index bb69f12..e87d3c3 100644 --- a/data/fz/tags/functions/module/config/buttons.json +++ b/data/fz/tags/functions/event/on_login.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "fz:module/config/buttons" + "fz:module/config/reset_trigger" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/module/config/display.json b/data/fz/tags/functions/module/config/display.json new file mode 100644 index 0000000..4608aa1 --- /dev/null +++ b/data/fz/tags/functions/module/config/display.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "#fz:module/scoreboard/config/display/head", + "#fz:module/scoreboard/config/display/buttons" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/config/install.json b/data/fz/tags/functions/module/config/install.json index 344aca7..9ede793 100644 --- a/data/fz/tags/functions/module/config/install.json +++ b/data/fz/tags/functions/module/config/install.json @@ -2,6 +2,6 @@ "__comment": "调用者:#fz:module/install", "replace": false, "values": [ - "fz:config/install" + "fz:module/config/install" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/module/config/load.json b/data/fz/tags/functions/module/config/load.json index 17fc863..4d5f8c6 100644 --- a/data/fz/tags/functions/module/config/load.json +++ b/data/fz/tags/functions/module/config/load.json @@ -2,6 +2,6 @@ "__comment": "调用者:fz:module/try_load", "replace": false, "values": [ - "fz:config/load" + "fz:module/config/load" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/module/config/uninstall.json b/data/fz/tags/functions/module/config/uninstall.json index b71840f..c3ac6ad 100644 --- a/data/fz/tags/functions/module/config/uninstall.json +++ b/data/fz/tags/functions/module/config/uninstall.json @@ -2,6 +2,6 @@ "__comment": "调用者:#fz:module/uninstall", "replace": false, "values": [ - "fz:config/uninstall" + "fz:module/config/uninstall" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/config/display/buttons.json b/data/fz/tags/functions/module/scoreboard/config/display/buttons.json new file mode 100644 index 0000000..0060eb2 --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/config/display/buttons.json @@ -0,0 +1,7 @@ +{ + "__comment": "调用者:#fz:module/config/display", + "replace": false, + "values": [ + "fz:module/scoreboard/config/display/buttons" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/config/display/head.json b/data/fz/tags/functions/module/scoreboard/config/display/head.json new file mode 100644 index 0000000..6ce6cd3 --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/config/display/head.json @@ -0,0 +1,7 @@ +{ + "__comment": "调用者:#fz:module/config/display", + "replace": false, + "values": [ + "fz:module/scoreboard/config/display/head" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/config/on_click.json b/data/fz/tags/functions/module/scoreboard/config/on_click.json new file mode 100644 index 0000000..5cafe16 --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/config/on_click.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/scoreboard/config/on_click" + ] +} \ No newline at end of file