diff --git a/README.md b/README.md index 7253271..9d442a3 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,12 @@ A Minecraft Datapack ### 总览 - v2.1.x支持Minecraft1.17+ - v2.0.x支持Minecraft1.16.3-1.16.5 +- 为/tagplayer tp指令添加了配置文件 +- 为榜单恢复插件新增新版本的新方块 - 抬头并按一下shift来打开设置界面 +- 提供玩家挖掘、死亡、击杀、受伤、交易、钓鱼、滑翔、(破基岩)数据的榜单 + - 无需配置即可支持该铁头功破基岩榜Mod:https://gitee.com/harvey-husky/FZ-BBL/releases + - 破基岩榜的分数和订阅设置会在铁头功记分板的总分大于0时显示,以免未添加该mod的服务器显示破基岩榜 - 提供一些地毯脚本:*请在升级数据包的同时替换这些工具!!* - 安装方法: - 需要carpet mod 1.4.24+:https://github.com/gnembon/fabric-carpet/releases @@ -43,8 +48,8 @@ A Minecraft Datapack - 输入“/restore_scores by_whitelist”开始恢复 - 输入“/script unload restore_scores”卸载工具 - 记得用完就删掉它! -- 无需配置即可支持该铁头功破基岩榜Mod:https://gitee.com/harvey-husky/FZ-BBL/releases - - 破基岩榜的分数和订阅设置会在铁头功记分板的总分大于0时显示,以免未添加该mod的服务器显示破基岩榜 +##### v2.1.1/2.0.9 +- 添加鞘翅滑翔距离榜单 ##### v2.1.0 - 仅支持1.17+ - 修复使用部分工具和方块交互时挖掘榜会减分的bug diff --git a/data/fz/advancements/scoreboards/aviate1m.json b/data/fz/advancements/scoreboards/aviate1m.json new file mode 100644 index 0000000..70590d0 --- /dev/null +++ b/data/fz/advancements/scoreboards/aviate1m.json @@ -0,0 +1,24 @@ +{ + "criteria": { + "activation": { + "trigger": "minecraft:tick", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "fz.aviateCounter": { + "min": 200, + "max": 2147483647 + } + } + } + ] + } + } + }, + "rewards": { + "function": "fz:scoreboards/aviate1m/calculator" + } +} \ No newline at end of file diff --git a/data/fz/functions/config/display.mcfunction b/data/fz/functions/config/display.mcfunction index a21007a..4435cdd 100644 --- a/data/fz/functions/config/display.mcfunction +++ b/data/fz/functions/config/display.mcfunction @@ -22,6 +22,7 @@ execute if data storage fz.installed {sweeper: 1b} run tellraw @s {"text": "扫 execute if data storage fz.installed {scoreboards: 1b} run tellraw @s {"text": "记分板:","color": "#ccff00"} ##计分板显示,对应分数1838019370-1838019379 execute if data storage fz.installed {scoreboards: 1b} unless score 全员头铁 bedrockBreaked matches 1.. run tellraw @s [{"text": "- "},{"text": "[关]","color": "#ff0000","hoverEvent": {"action": "show_text","contents": {"text": "关", "color": "#ff0000"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019370"}},{"text": "[轮播]","color": "gold","hoverEvent": {"action": "show_text","contents": {"text": "轮播", "color": "gold"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019371"}},{"text": "[总量]","color": "dark_aqua","hoverEvent": {"action": "show_text","contents": {"text": "总量","color": "dark_aqua"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019379"}},{"text": "[在线时间(h)]","color": "aqua","hoverEvent": {"action": "show_text","contents": {"text": "在线时间(h)","color": "aqua"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019372"}},{"text": "[抖M名单]","color": "yellow","hoverEvent": {"action": "show_text","contents": {"text": "受伤害量","color": "yellow"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019373"}},{"text": "[死亡榜]","color": "dark_red","hoverEvent": {"action": "show_text","contents": {"text": "死亡榜","color": "dark_red"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019374"}},{"text": "[挖掘榜]","color": "gray","hoverEvent": {"action": "show_text","contents": {"text": "挖掘榜","color": "gray"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019375"}},{"text": "[钩直饵咸]","color": "blue","hoverEvent": {"action": "show_text","contents": {"text": "钓鱼榜","color": "blue"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019376"}},{"text": "[击杀榜]","color": "red","hoverEvent": {"action": "show_text","contents": {"text": "击杀榜","color": "red"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019377"}},{"text": "[交♂易榜]","color": "green","hoverEvent": {"action": "show_text","contents": {"text": "交易榜","color": "green"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019378"}}] + execute if data storage fz.installed {scoreboards: 1b} unless score 全员头铁 bedrockBreaked matches 1.. run tellraw @s [{"text": "- "},{"text": "[滑翔距离]", "color": "light_purple", "hoverEvent": {"action": "show_text","contents": {"text": "滑翔距离", "color": "light_purple"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019368"}}] ##计分板显示,对应分数1838019369-1838019379(有破基岩榜) execute if data storage fz.installed {scoreboards: 1b} if score 全员头铁 bedrockBreaked matches 1.. run tellraw @s [{"text": "- "},{"text": "[关]","color": "#ff0000","hoverEvent": {"action": "show_text","contents": {"text": "关", "color": "#ff0000"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019370"}},{"text": "[轮播]","color": "gold","hoverEvent": {"action": "show_text","contents": {"text": "轮播", "color": "gold"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019371"}},{"text": "[总量]","color": "dark_aqua","hoverEvent": {"action": "show_text","contents": {"text": "总量","color": "dark_aqua"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019379"}},{"text": "[在线时间(h)]","color": "aqua","hoverEvent": {"action": "show_text","contents": {"text": "在线时间(h)","color": "aqua"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019372"}},{"text": "[抖M名单]","color": "yellow","hoverEvent": {"action": "show_text","contents": {"text": "受伤害量","color": "yellow"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019373"}},{"text": "[死亡榜]","color": "dark_red","hoverEvent": {"action": "show_text","contents": {"text": "死亡榜","color": "dark_red"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019374"}},{"text": "[挖掘榜]","color": "gray","hoverEvent": {"action": "show_text","contents": {"text": "挖掘榜","color": "gray"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019375"}},{"text": "[钩直饵咸]","color": "blue","hoverEvent": {"action": "show_text","contents": {"text": "钓鱼榜","color": "blue"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019376"}},{"text": "[击杀榜]","color": "red","hoverEvent": {"action": "show_text","contents": {"text": "击杀榜","color": "red"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019377"}},{"text": "[交♂易榜]","color": "green","hoverEvent": {"action": "show_text","contents": {"text": "交易榜","color": "green"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019378"}}] - execute if data storage fz.installed {scoreboards: 1b} if score 全员头铁 bedrockBreaked matches 1.. run tellraw @s [{"text": "- "},{"text": "[铁头功]","color": "dark_green","hoverEvent": {"action": "show_text","contents": {"text": "破基岩榜","color": "dark_green"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019369"}}] + execute if data storage fz.installed {scoreboards: 1b} if score 全员头铁 bedrockBreaked matches 1.. run tellraw @s [{"text": "- "},{"text": "[滑翔距离]", "color": "light_purple", "hoverEvent": {"action": "show_text","contents": {"text": "滑翔距离", "color": "light_purple"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019368"}},{"text": "[铁头功]","color": "dark_green","hoverEvent": {"action": "show_text","contents": {"text": "破基岩榜","color": "dark_green"}},"clickEvent": {"action": "run_command","value": "/trigger config set 1838019369"}}] diff --git a/data/fz/functions/config/main.mcfunction b/data/fz/functions/config/main.mcfunction index 7dde148..4b87f9b 100644 --- a/data/fz/functions/config/main.mcfunction +++ b/data/fz/functions/config/main.mcfunction @@ -3,6 +3,6 @@ scoreboard players enable @a config #每条子函数都要reset config分数和function fz:config/display execute if data storage fz.installed {sweeper: 1b} as @a if score @s config matches 1478966200..1478966217 run function fz:sweeper/config/trigger -execute if data storage fz.installed {scoreboards: 1b} as @a if score @s config matches 1838019369..1838019379 run function fz:scoreboards/config +execute if data storage fz.installed {scoreboards: 1b} as @a if score @s config matches 1838019368..1838019379 run function fz:scoreboards/config #循环执行本函数 schedule function fz:config/main 1t \ No newline at end of file diff --git a/data/fz/functions/install.mcfunction b/data/fz/functions/install.mcfunction index 4b281bb..afd57f2 100644 --- a/data/fz/functions/install.mcfunction +++ b/data/fz/functions/install.mcfunction @@ -16,9 +16,9 @@ function fz:login/logintips/install function fz:carpet/carpet #版本信息 data merge storage fz.installed {installed: 1b} -data merge storage fz {version: 2.0.3} -data merge storage fz {date: 2020-1.17} -data merge storage fz {time: "18:21"} +data merge storage fz {version: 2.0.9} +data merge storage fz {date: 2021-7.21} +data merge storage fz {time: "1:03"} ##data merge storage fz {snapshot: -SNAPSHOT} data remove storage fz snapshot tellraw @a {"text": "[信息]启动完毕","color": "#5fff00"} diff --git a/data/fz/functions/scoreboards/aviate1m/calculator.mcfunction b/data/fz/functions/scoreboards/aviate1m/calculator.mcfunction new file mode 100644 index 0000000..df423a4 --- /dev/null +++ b/data/fz/functions/scoreboards/aviate1m/calculator.mcfunction @@ -0,0 +1,11 @@ +#计算滑翔距离和总榜 +#判断条件用于排除地毯小人 +execute unless score @s carpetBot matches 1 run scoreboard players operation @s fz.aviateOneTime = @s fz.aviateCounter +execute unless score @s carpetBot matches 1 run scoreboard players operation @s fz.aviateOneTime /= 200 calculator +execute unless score @s carpetBot matches 1 run scoreboard players operation @s fz.aviate1m += @s fz.aviateOneTime +execute unless score @s carpetBot matches 1 run scoreboard players operation 总滑翔距离 fz.aviate1m += @s fz.aviateOneTime +execute unless score @s carpetBot matches 1 run scoreboard players operation 总滑翔距离 totalList += @s fz.aviateOneTime +#重置滑翔探测记分板 +scoreboard players operation @s fz.aviateCounter %= 200 calculator +#重置触发该函数的成就 +advancement revoke @s only fz:scoreboards/aviate1m \ No newline at end of file diff --git a/data/fz/functions/scoreboards/aviate1m/setdisplay.mcfunction b/data/fz/functions/scoreboards/aviate1m/setdisplay.mcfunction new file mode 100644 index 0000000..84c3cdf --- /dev/null +++ b/data/fz/functions/scoreboards/aviate1m/setdisplay.mcfunction @@ -0,0 +1,2 @@ +#将交易榜显示给轮播记分板的队伍(金队) +scoreboard objectives setdisplay sidebar.team.gold fz.aviate1m \ No newline at end of file diff --git a/data/fz/functions/scoreboards/bedrockbreaked/calculator.mcfunction b/data/fz/functions/scoreboards/bedrockbreaked/calculator.mcfunction index 11fb9ec..fbcef61 100644 --- a/data/fz/functions/scoreboards/bedrockbreaked/calculator.mcfunction +++ b/data/fz/functions/scoreboards/bedrockbreaked/calculator.mcfunction @@ -3,6 +3,6 @@ execute unless score @s carpetBot matches 1 run scoreboard players operation @s bedrockBreaked += @s fz.bbl execute unless score @s carpetBot matches 1 run scoreboard players operation 全员头铁 bedrockBreaked += @s fz.bbl execute unless score @s carpetBot matches 1 run scoreboard players operation 全员头铁 totalList += @s fz.bbl -execute unless score @s carpetBot matches 1 run scoreboard players reset @s fz.bbl +scoreboard players reset @s fz.bbl #重置触发该函数的成就 advancement revoke @s only fz:scoreboards/bedrockbreaked \ No newline at end of file diff --git a/data/fz/functions/scoreboards/config.mcfunction b/data/fz/functions/scoreboards/config.mcfunction index 9305fd1..d427da6 100644 --- a/data/fz/functions/scoreboards/config.mcfunction +++ b/data/fz/functions/scoreboards/config.mcfunction @@ -10,6 +10,7 @@ execute if score @s config matches 1838019377 run team join red execute if score @s config matches 1838019378 run team join green execute if score @s config matches 1838019379 run team join dark_aqua execute if score @s config matches 1838019369 run team join dark_green +execute if score @s config matches 1838019368 run team join light_purple #每条子函数都要reset config分数和function fz:config/display scoreboard players reset @s config function fz:config/display \ No newline at end of file diff --git a/data/fz/functions/scoreboards/delscore.mcfunction b/data/fz/functions/scoreboards/delscore.mcfunction index 5dae1b1..65e356d 100644 --- a/data/fz/functions/scoreboards/delscore.mcfunction +++ b/data/fz/functions/scoreboards/delscore.mcfunction @@ -8,5 +8,6 @@ scoreboard objectives remove damageTaken scoreboard objectives remove activation scoreboard objectives remove totalList scoreboard objectives remove bedrockBreaked +scoreboard objectives remove fz.aviate1m #提示已删除 tellraw @a {"text": "[信息]计分板数据已删除","color": "#5fff00"} \ No newline at end of file diff --git a/data/fz/functions/scoreboards/install.mcfunction b/data/fz/functions/scoreboards/install.mcfunction index 1785bed..e199649 100644 --- a/data/fz/functions/scoreboards/install.mcfunction +++ b/data/fz/functions/scoreboards/install.mcfunction @@ -39,7 +39,10 @@ scoreboard objectives add damageTaken dummy scoreboard objectives add activation dummy scoreboard objectives add totalList dummy scoreboard objectives add bedrockBreaked dummy -scoreboard objectives add fz.bbl dummy + scoreboard objectives add fz.bbl dummy +scoreboard objectives add fz.aviate1m dummy + scoreboard objectives add fz.aviateCounter minecraft.custom:aviate_one_cm + scoreboard objectives add fz.aviateOneTime dummy scoreboard objectives modify activation displayname {"text": "活跃时间(h)","color": "aqua"} scoreboard objectives modify damageTaken displayname {"text": "抖M名单","color": "yellow"} @@ -50,6 +53,7 @@ scoreboard objectives modify killCounter displayname {"text": "击杀榜","color scoreboard objectives modify tradingCounter displayname {"text": "交♂易榜","color": "green"} scoreboard objectives modify totalList displayname {"text": "总 量","color": "dark_aqua"} scoreboard objectives modify bedrockBreaked displayname {"text": "铁头功","color": "dark_green"} +scoreboard objectives modify fz.aviate1m displayname {"text": "滑翔距离","color": "light_purple"} team add gold team add aqua @@ -61,6 +65,8 @@ team add red team add green team add dark_aqua team add dark_green +team add light_purple + team modify gold color gold team modify aqua color aqua team modify yellow color yellow @@ -71,6 +77,7 @@ team modify red color red team modify dark_aqua color dark_aqua team modify green color green team modify dark_green color dark_green +team modify light_purple color light_purple team join aqua 总在线时间(h) team join yellow 群p抖M @@ -80,6 +87,7 @@ team join blue 总钓鱼数 team join red 总击杀数 team join green 总交♂易数 team join dark_green 全员头铁 +team join light_purple 总滑翔距离 #各计分板的总量 scoreboard players operation 总在线时间(h) activation = 总在线时间(h) activation scoreboard players operation 群p抖M damageTaken = 群p抖M damageTaken @@ -88,6 +96,7 @@ scoreboard players operation 总挖掘量 digCounter = 总挖掘量 digCounter scoreboard players operation 总钓鱼数 fishingCounter = 总钓鱼数 fishingCounter scoreboard players operation 总击杀数 killCounter = 总击杀数 killCounter scoreboard players operation 总交♂易数 tradingCounter = 总交♂易数 tradingCounter +scoreboard players operation 总滑翔距离 fz.aviate1m = 总滑翔距离 fz.aviate1m #总榜的总量 scoreboard players operation 总在线时间(h) totalList = 总在线时间(h) totalList scoreboard players operation 群p抖M totalList = 群p抖M totalList @@ -96,6 +105,7 @@ scoreboard players operation 总挖掘量 totalList = 总挖掘量 totalList scoreboard players operation 总钓鱼数 totalList = 总钓鱼数 totalList scoreboard players operation 总击杀数 totalList = 总击杀数 totalList scoreboard players operation 总交♂易数 totalList = 总交♂易数 totalList +scoreboard players operation 总滑翔距离 totalList = 总滑翔距离 totalList scoreboard objectives setdisplay sidebar.team.aqua activation scoreboard objectives setdisplay sidebar.team.yellow damageTaken @@ -106,6 +116,7 @@ scoreboard objectives setdisplay sidebar.team.red killCounter scoreboard objectives setdisplay sidebar.team.dark_aqua totalList scoreboard objectives setdisplay sidebar.team.green tradingCounter scoreboard objectives setdisplay sidebar.team.dark_green bedrockBreaked +scoreboard objectives setdisplay sidebar.team.light_purple fz.aviate1m data merge storage fz.installed {scoreboards:1b} diff --git a/data/fz/functions/scoreboards/main.mcfunction b/data/fz/functions/scoreboards/main.mcfunction index d472cd3..3fa7146 100644 --- a/data/fz/functions/scoreboards/main.mcfunction +++ b/data/fz/functions/scoreboards/main.mcfunction @@ -5,7 +5,8 @@ schedule function fz:scoreboards/tradingcounter/setdisplay 30s replace schedule function fz:scoreboards/fishingcounter/setdisplay 40s replace schedule function fz:scoreboards/damagetaken/setdisplay 50s replace schedule function fz:scoreboards/activation/setdisplay 60s replace -schedule function fz:scoreboards/totallist 70s replace -execute if score 全员头铁 bedrockBreaked matches 1.. run schedule function fz:scoreboards/bedrockbreaked/setdisplay 80s replace -execute if score 全员头铁 bedrockBreaked matches 1.. run schedule function fz:scoreboards/main 90s replace -execute unless score 全员头铁 bedrockBreaked matches 1.. run schedule function fz:scoreboards/main 80s replace \ No newline at end of file +schedule function fz:scoreboards/aviate1m/setdisplay 70s replace +schedule function fz:scoreboards/totallist 80s replace +execute if score 全员头铁 bedrockBreaked matches 1.. run schedule function fz:scoreboards/bedrockbreaked/setdisplay 90s replace +execute if score 全员头铁 bedrockBreaked matches 1.. run schedule function fz:scoreboards/main 100s replace +execute unless score 全员头铁 bedrockBreaked matches 1.. run schedule function fz:scoreboards/main 90s replace \ No newline at end of file diff --git a/data/fz/functions/scoreboards/uninstall.mcfunction b/data/fz/functions/scoreboards/uninstall.mcfunction index 4d0e5b3..b23db68 100644 --- a/data/fz/functions/scoreboards/uninstall.mcfunction +++ b/data/fz/functions/scoreboards/uninstall.mcfunction @@ -35,11 +35,13 @@ scoreboard objectives remove usedNetAxe scoreboard objectives remove usedNetPickaxe scoreboard objectives remove usedNetShovel scoreboard objectives remove usedNetHoe -scoreboard objectives remove fz.bbl +scoreboard objectives remove fz.bbl scoreboard objectives remove deathTester scoreboard objectives remove fishingTester scoreboard objectives remove 10xDamageTaken +scoreboard objectives remove fz.aviateCounter +scoreboard objectives remove fz.aviateOneTime scoreboard objectives setdisplay sidebar.team.aqua scoreboard objectives setdisplay sidebar.team.yellow