diff --git a/data/fz/advancements/event/on_aviate_one_meter.json b/data/fz/advancements/event/on_aviate_one_meter.json new file mode 100644 index 0000000..f4ce9fb --- /dev/null +++ b/data/fz/advancements/event/on_aviate_one_meter.json @@ -0,0 +1,23 @@ +{ + "criteria": { + "on_aviate_one_meter": { + "trigger": "minecraft:tick", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "fz.event.aviating_distance": { + "min": 200 + } + } + } + ] + } + } + }, + "rewards": { + "function": "fz:event/on_aviate_one_meter" + } +} \ No newline at end of file diff --git a/data/fz/advancements/event/on_damage_taken.json b/data/fz/advancements/event/on_damage_taken.json new file mode 100644 index 0000000..efaa391 --- /dev/null +++ b/data/fz/advancements/event/on_damage_taken.json @@ -0,0 +1,23 @@ +{ + "criteria": { + "on_damage_taken": { + "trigger": "minecraft:tick", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "fz.event.damage_taken": { + "min": 1 + } + } + } + ] + } + } + }, + "rewards": { + "function": "fz:event/on_damage_taken" + } +} \ No newline at end of file diff --git a/data/fz/advancements/login.json b/data/fz/advancements/event/on_login.json similarity index 96% rename from data/fz/advancements/login.json rename to data/fz/advancements/event/on_login.json index af3301c..8feae53 100644 --- a/data/fz/advancements/login.json +++ b/data/fz/advancements/event/on_login.json @@ -1,6 +1,6 @@ { "criteria": { - "login": { + "on_login": { "trigger": "tick", "conditions": { "player": [ diff --git a/data/fz/advancements/piglin_trade.json b/data/fz/advancements/event/on_piglin_trade.json similarity index 91% rename from data/fz/advancements/piglin_trade.json rename to data/fz/advancements/event/on_piglin_trade.json index 6fedb96..d295d37 100644 --- a/data/fz/advancements/piglin_trade.json +++ b/data/fz/advancements/event/on_piglin_trade.json @@ -1,6 +1,6 @@ { "criteria": { - "piglin_trade": { + "on_piglin_trade": { "trigger": "minecraft:thrown_item_picked_up_by_entity", "conditions": { "entity": { diff --git a/data/fz/advancements/play_one_hour.json b/data/fz/advancements/event/on_play_one_hour.json similarity index 84% rename from data/fz/advancements/play_one_hour.json rename to data/fz/advancements/event/on_play_one_hour.json index 9ff3a88..4216652 100644 --- a/data/fz/advancements/play_one_hour.json +++ b/data/fz/advancements/event/on_play_one_hour.json @@ -1,6 +1,6 @@ { "criteria": { - "play_one_hour": { + "on_play_one_hour": { "trigger": "minecraft:tick", "conditions": { "player": [ @@ -8,7 +8,7 @@ "condition": "minecraft:entity_scores", "entity": "this", "scores": { - "fz.module.scoreboard.assign.activation": { + "fz.event.play_seconds": { "min": 3600 } } diff --git a/data/fz/advancements/sneak.json b/data/fz/advancements/event/on_sneak.json similarity index 92% rename from data/fz/advancements/sneak.json rename to data/fz/advancements/event/on_sneak.json index 3037c7f..2863d37 100644 --- a/data/fz/advancements/sneak.json +++ b/data/fz/advancements/event/on_sneak.json @@ -1,6 +1,6 @@ { "criteria": { - "sneak": { + "on_sneak": { "trigger": "minecraft:tick", "conditions": { "player": { diff --git a/data/fz/advancements/unsneak.json b/data/fz/advancements/event/on_unsneak.json similarity index 95% rename from data/fz/advancements/unsneak.json rename to data/fz/advancements/event/on_unsneak.json index 14ccadc..a380109 100644 --- a/data/fz/advancements/unsneak.json +++ b/data/fz/advancements/event/on_unsneak.json @@ -1,7 +1,7 @@ { "parent": "fz:sneak", "criteria": { - "unsneak": { + "on_unsneak": { "trigger": "minecraft:tick", "conditions": { "player": { diff --git a/data/fz/advancements/villager_trade.json b/data/fz/advancements/event/on_villager_trade.json similarity index 83% rename from data/fz/advancements/villager_trade.json rename to data/fz/advancements/event/on_villager_trade.json index 058bb49..cf23c64 100644 --- a/data/fz/advancements/villager_trade.json +++ b/data/fz/advancements/event/on_villager_trade.json @@ -1,6 +1,6 @@ { "criteria": { - "villager_trade": { + "on_villager_trade": { "trigger": "minecraft:villager_trade" } }, diff --git a/data/fz/functions/event/init.mcfunction b/data/fz/functions/event/init.mcfunction index 7c846a8..932851f 100644 --- a/data/fz/functions/event/init.mcfunction +++ b/data/fz/functions/event/init.mcfunction @@ -1,4 +1,12 @@ +scoreboard objectives add fz.event.play_seconds minecraft.custom:play_time + scoreboard objectives add fz.event.leave_game minecraft.custom:leave_game +scoreboard objectives add fz.event.aviating_distance minecraft.custom:aviate_one_cm + +scoreboard objectives add fz.event.damage_taken minecraft.custom:damage_taken + +scoreboard objectives add fz.event.fishing_count minecraft.custom:fish_caught + ## 调试 execute if score fz.logger.level fz.variable.integer matches ..500 run tellraw @a [{"nbt": "fz.level.info", "interpret": true, "storage": "fz:logger"}, {"text": "已初始化系统组件:事件"}] \ No newline at end of file diff --git a/data/fz/functions/event/on_aviate_one_meter.mcfunction b/data/fz/functions/event/on_aviate_one_meter.mcfunction new file mode 100644 index 0000000..8756964 --- /dev/null +++ b/data/fz/functions/event/on_aviate_one_meter.mcfunction @@ -0,0 +1,6 @@ +scoreboard players operation fz.var.score fz.variable.integer = @s fz.event.aviating_distance + +function #fz:event/on_aviate_one_meter + +scoreboard players operation @s fz.event.aviating_distance %= 200 fz.variable.integer +advancement revoke @s only fz:event/on_aviate_one_meter \ No newline at end of file diff --git a/data/fz/functions/event/on_damage_taken.mcfunction b/data/fz/functions/event/on_damage_taken.mcfunction new file mode 100644 index 0000000..eaad76e --- /dev/null +++ b/data/fz/functions/event/on_damage_taken.mcfunction @@ -0,0 +1,6 @@ +scoreboard players operation fz.var.score fz.variable.integer = @s fz.event.damage_taken + +function #fz:event/on_damage_taken + +scoreboard players set @s fz.event.damage_taken 0 +advancement revoke @s only fz:event/on_damage_taken \ No newline at end of file diff --git a/data/fz/functions/event/on_login.mcfunction b/data/fz/functions/event/on_login.mcfunction index 3ad589a..7c36d51 100644 --- a/data/fz/functions/event/on_login.mcfunction +++ b/data/fz/functions/event/on_login.mcfunction @@ -4,8 +4,13 @@ execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @ function #fz:event/on_login ## 复位其他触发器 -advancement revoke @s until fz:unsneak +advancement revoke @s until fz:event/on_damage_taken +advancement revoke @s until fz:event/on_piglin_trade +advancement revoke @s until fz:event/on_play_one_hour +advancement revoke @s until fz:event/on_sneak +advancement revoke @s until fz:event/on_unsneak +advancement revoke @s until fz:event/on_villager_trade ## 复位进度触发器 scoreboard players set @s fz.event.leave_game 0 -advancement revoke @s only fz:login \ No newline at end of file +advancement revoke @s only fz:event/on_login \ No newline at end of file diff --git a/data/fz/functions/event/on_piglin_trade.mcfunction b/data/fz/functions/event/on_piglin_trade.mcfunction index ae4c7d5..6360530 100644 --- a/data/fz/functions/event/on_piglin_trade.mcfunction +++ b/data/fz/functions/event/on_piglin_trade.mcfunction @@ -1,2 +1,2 @@ function #fz:event/on_piglin_trade -advancement revoke @s only fz:piglin_trade \ No newline at end of file +advancement revoke @s only fz:event/on_piglin_trade \ No newline at end of file diff --git a/data/fz/functions/event/on_play_one_hour.mcfunction b/data/fz/functions/event/on_play_one_hour.mcfunction index 2000051..596ebef 100644 --- a/data/fz/functions/event/on_play_one_hour.mcfunction +++ b/data/fz/functions/event/on_play_one_hour.mcfunction @@ -1,4 +1,6 @@ +scoreboard players operation fz.var.score fz.variable.integer = @s fz.event.play_seconds + function #fz:event/on_play_one_hour -scoreboard players remove @s fz.module.scoreboard.assign.activation 3600 -advancement revoke @s only fz:play_one_hour \ No newline at end of file +scoreboard players operation @s fz.event.play_seconds %= 3600 fz.variable.integer +advancement revoke @s only fz:event/on_play_one_hour \ No newline at end of file diff --git a/data/fz/functions/event/on_unsneak.mcfunction b/data/fz/functions/event/on_unsneak.mcfunction index b45cab2..d8cde9b 100644 --- a/data/fz/functions/event/on_unsneak.mcfunction +++ b/data/fz/functions/event/on_unsneak.mcfunction @@ -9,4 +9,4 @@ function #fz:event/on_unsneak execute if entity @s[x_rotation = -90] run function #fz:event/module/config/on_config ## 复位进度触发器 -advancement revoke @s until fz:unsneak \ No newline at end of file +advancement revoke @s until fz:event/on_unsneak \ No newline at end of file diff --git a/data/fz/functions/event/on_villager_trade.mcfunction b/data/fz/functions/event/on_villager_trade.mcfunction index 9680929..1fe8571 100644 --- a/data/fz/functions/event/on_villager_trade.mcfunction +++ b/data/fz/functions/event/on_villager_trade.mcfunction @@ -1,2 +1,2 @@ function #fz:event/on_villager_trade -advancement revoke @s only fz:villager_trade \ No newline at end of file +advancement revoke @s only fz:event/on_villager_trade \ No newline at end of file diff --git a/data/fz/functions/load.mcfunction b/data/fz/functions/load.mcfunction index 078012b..6a08fd9 100644 --- a/data/fz/functions/load.mcfunction +++ b/data/fz/functions/load.mcfunction @@ -2,6 +2,8 @@ ## 常量 scoreboard players set 10 fz.variable.integer 10 +scoreboard players set 200 fz.variable.integer 200 +scoreboard players set 3600 fz.variable.integer 3600 function #fz:module/try_load diff --git a/data/fz/functions/module/scoreboard/assign/create_scoreboards.mcfunction b/data/fz/functions/module/scoreboard/assign/create_scoreboards.mcfunction index f15df0c..3153e7b 100644 --- a/data/fz/functions/module/scoreboard/assign/create_scoreboards.mcfunction +++ b/data/fz/functions/module/scoreboard/assign/create_scoreboards.mcfunction @@ -1,15 +1,3 @@ # 源计分板 ## 总榜 scoreboard objectives add fz.module.scoreboard.assign.general dummy - -### 活跃度 -scoreboard objectives add fz.module.scoreboard.assign.activation minecraft.custom:play_time - -### 飞行距离 -scoreboard objectives add fz.module.scoreboard.assign.aviating_distance minecraft.custom:aviate_one_cm - -### 抖M榜 -scoreboard objectives add fz.module.scoreboard.assign.damage_taken minecraft.custom:damage_taken - -### 钓鱼榜 -scoreboard objectives add fz.module.scoreboard.assign.fishing_count minecraft.custom:fish_caught \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/assign/set_display/activation.mcfunction b/data/fz/functions/module/scoreboard/assign/set_display/activation.mcfunction index 09e998b..9711bf8 100644 --- a/data/fz/functions/module/scoreboard/assign/set_display/activation.mcfunction +++ b/data/fz/functions/module/scoreboard/assign/set_display/activation.mcfunction @@ -1,3 +1,3 @@ scoreboard players add @s fz.module.scoreboard.display.activation 1 scoreboard players add fz.module.scoreboard.total.activation fz.module.scoreboard.assign.general 1 -function #fz:module/scoreboard/assign/set_display/custom_total_name/activation \ No newline at end of file +function #fz:module/scoreboard/assign/set_display/total_name/activation \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/assign/set_display/aviating_distance.mcfunction b/data/fz/functions/module/scoreboard/assign/set_display/aviating_distance.mcfunction new file mode 100644 index 0000000..3715f8d --- /dev/null +++ b/data/fz/functions/module/scoreboard/assign/set_display/aviating_distance.mcfunction @@ -0,0 +1,4 @@ +scoreboard players operation fz.var.score fz.variable.integer /= 200 fz.variable.integer +scoreboard players operation @s fz.module.scoreboard.display.aviating_distance += fz.var.score fz.variable.integer +scoreboard players operation fz.module.scoreboard.total.aviating_distance fz.module.scoreboard.assign.general += fz.var.score fz.variable.integer +function #fz:module/scoreboard/assign/set_display/total_name/aviating_distance \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/assign/set_display/damage_taken.mcfunction b/data/fz/functions/module/scoreboard/assign/set_display/damage_taken.mcfunction new file mode 100644 index 0000000..3ae6b7c --- /dev/null +++ b/data/fz/functions/module/scoreboard/assign/set_display/damage_taken.mcfunction @@ -0,0 +1,3 @@ +scoreboard players operation @s fz.module.scoreboard.display.damage_taken += fz.var.score fz.variable.integer +scoreboard players operation fz.module.scoreboard.total.damage_taken fz.module.scoreboard.assign.general += fz.var.score fz.variable.integer +function #fz:module/scoreboard/assign/set_display/total_name/damage_taken \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/assign/set_display/custom_total_name/activation.mcfunction b/data/fz/functions/module/scoreboard/assign/set_display/total_name/activation.mcfunction similarity index 100% rename from data/fz/functions/module/scoreboard/assign/set_display/custom_total_name/activation.mcfunction rename to data/fz/functions/module/scoreboard/assign/set_display/total_name/activation.mcfunction diff --git a/data/fz/functions/module/scoreboard/assign/set_display/total_name/aviating_distance.mcfunction b/data/fz/functions/module/scoreboard/assign/set_display/total_name/aviating_distance.mcfunction new file mode 100644 index 0000000..a08efcb --- /dev/null +++ b/data/fz/functions/module/scoreboard/assign/set_display/total_name/aviating_distance.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 总飞行距离 fz.module.scoreboard.display.general = fz.module.scoreboard.total.aviating_distance fz.module.scoreboard.assign.general +scoreboard players operation 总飞行距离 fz.module.scoreboard.display.aviating_distance = fz.module.scoreboard.total.aviating_distance fz.module.scoreboard.assign.general \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/assign/set_display/total_name/damage_taken.mcfunction b/data/fz/functions/module/scoreboard/assign/set_display/total_name/damage_taken.mcfunction new file mode 100644 index 0000000..1807a23 --- /dev/null +++ b/data/fz/functions/module/scoreboard/assign/set_display/total_name/damage_taken.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 总受伤害量 fz.module.scoreboard.display.general = fz.module.scoreboard.total.damage_taken fz.module.scoreboard.assign.general +scoreboard players operation 总受伤害量 fz.module.scoreboard.display.damage_taken = fz.module.scoreboard.total.damage_taken fz.module.scoreboard.assign.general \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/assign/set_display/custom_total_name/trade_count.mcfunction b/data/fz/functions/module/scoreboard/assign/set_display/total_name/trade_count.mcfunction similarity index 100% rename from data/fz/functions/module/scoreboard/assign/set_display/custom_total_name/trade_count.mcfunction rename to data/fz/functions/module/scoreboard/assign/set_display/total_name/trade_count.mcfunction diff --git a/data/fz/functions/module/scoreboard/assign/set_display/trade_count.mcfunction b/data/fz/functions/module/scoreboard/assign/set_display/trade_count.mcfunction index 015103b..be7385d 100644 --- a/data/fz/functions/module/scoreboard/assign/set_display/trade_count.mcfunction +++ b/data/fz/functions/module/scoreboard/assign/set_display/trade_count.mcfunction @@ -1,3 +1,3 @@ scoreboard players add @s fz.module.scoreboard.display.trade_count 1 scoreboard players add fz.module.scoreboard.total.trade_count fz.module.scoreboard.assign.general 1 -function #fz:module/scoreboard/assign/set_display/custom_total_name/trade_count \ No newline at end of file +function #fz:module/scoreboard/assign/set_display/total_name/trade_count \ No newline at end of file diff --git a/data/fz/tags/functions/event/on_aviate_one_meter.json b/data/fz/tags/functions/event/on_aviate_one_meter.json new file mode 100644 index 0000000..802f9f3 --- /dev/null +++ b/data/fz/tags/functions/event/on_aviate_one_meter.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "#fz:module/scoreboard/assign/set_display/aviating_distance" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/event/on_damage_taken.json b/data/fz/tags/functions/event/on_damage_taken.json new file mode 100644 index 0000000..98602d4 --- /dev/null +++ b/data/fz/tags/functions/event/on_damage_taken.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "#fz:module/scoreboard/assign/set_display/damage_taken" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/event/on_play_one_hour.json b/data/fz/tags/functions/event/on_play_one_hour.json index 907e30b..e2913c2 100644 --- a/data/fz/tags/functions/event/on_play_one_hour.json +++ b/data/fz/tags/functions/event/on_play_one_hour.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - + "#fz:module/scoreboard/assign/set_display/activation" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/assign/set_display/aviating_distance.json b/data/fz/tags/functions/module/scoreboard/assign/set_display/aviating_distance.json new file mode 100644 index 0000000..fa5bd13 --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/assign/set_display/aviating_distance.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/scoreboard/assign/set_display/aviating_distance" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/assign/set_display/custom_total_name/activation.json b/data/fz/tags/functions/module/scoreboard/assign/set_display/custom_total_name/activation.json deleted file mode 100644 index c900c8c..0000000 --- a/data/fz/tags/functions/module/scoreboard/assign/set_display/custom_total_name/activation.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "fz:module/scoreboard/assign/set_display/custom_total_name/activation" - ] -} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/assign/set_display/custom_total_name/trade_count.json b/data/fz/tags/functions/module/scoreboard/assign/set_display/custom_total_name/trade_count.json deleted file mode 100644 index 243f68a..0000000 --- a/data/fz/tags/functions/module/scoreboard/assign/set_display/custom_total_name/trade_count.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "fz:module/scoreboard/assign/set_display/custom_total_name/trade_count" - ] -} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/assign/set_display/damage_taken.json b/data/fz/tags/functions/module/scoreboard/assign/set_display/damage_taken.json new file mode 100644 index 0000000..c3a4aab --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/assign/set_display/damage_taken.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/scoreboard/assign/set_display/damage_taken" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/assign/set_display/total_name/activation.json b/data/fz/tags/functions/module/scoreboard/assign/set_display/total_name/activation.json new file mode 100644 index 0000000..b42990e --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/assign/set_display/total_name/activation.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/scoreboard/assign/set_display/total_name/activation" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/assign/set_display/total_name/aviating_distance.json b/data/fz/tags/functions/module/scoreboard/assign/set_display/total_name/aviating_distance.json new file mode 100644 index 0000000..fb5bd9c --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/assign/set_display/total_name/aviating_distance.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/scoreboard/assign/set_display/total_name/aviating_distance" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/assign/set_display/total_name/damage_taken.json b/data/fz/tags/functions/module/scoreboard/assign/set_display/total_name/damage_taken.json new file mode 100644 index 0000000..7bd8a91 --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/assign/set_display/total_name/damage_taken.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/scoreboard/assign/set_display/total_name/damage_taken" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/assign/set_display/total_name/trade_count.json b/data/fz/tags/functions/module/scoreboard/assign/set_display/total_name/trade_count.json new file mode 100644 index 0000000..bb11717 --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/assign/set_display/total_name/trade_count.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/scoreboard/assign/set_display/total_name/trade_count" + ] +} \ No newline at end of file