From b2843145af20d094c3d7b9c5b36ed747c97ebca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=B6=E7=9A=93?= <1214946206@qq.com> Date: Sat, 3 Jul 2021 06:21:34 +0800 Subject: [PATCH] 2.1.0 --- LICENSE | 8 +- README.md | 38 +- data/fz/advancements/leavegame.json | 1 - .../scoreboards/bedrockbreaked.json | 23 + .../advancements/scoreboards/damagetaken.json | 3 +- .../scoreboards/deathcounter.json | 3 +- .../scoreboards/digcounter/digtrigger.json | 77 +- .../scoreboards/digcounter/toolsfix.json | 517 +--- .../scoreboards/fishingcounter.json | 3 +- data/fz/functions/carpet/carpet.mcfunction | 4 +- data/fz/functions/config/display.mcfunction | 27 +- data/fz/functions/config/install.mcfunction | 2 +- data/fz/functions/config/main.mcfunction | 6 +- data/fz/functions/config/start.mcfunction | 2 + data/fz/functions/config/turnon.mcfunction | 6 +- data/fz/functions/config/uninstall.mcfunction | 2 +- data/fz/functions/config/unsneak.mcfunction | 2 +- data/fz/functions/health/install.mcfunction | 2 +- data/fz/functions/health/uninstall.mcfunction | 2 +- data/fz/functions/install.mcfunction | 12 +- data/fz/functions/load.mcfunction | 6 +- .../login/logintips/install.mcfunction | 2 +- .../login/logintips/uninstall.mcfunction | 2 +- data/fz/functions/login/onlogin.mcfunction | 4 +- ...ation.mcfunction => setdisplay.mcfunction} | 2 +- .../bedrockbreaked/calculator.mcfunction | 8 + .../bedrockbreaked/setdisplay.mcfunction | 2 + .../functions/scoreboards/config.mcfunction | 3 +- ...taken.mcfunction => setdisplay.mcfunction} | 2 +- ...unter.mcfunction => setdisplay.mcfunction} | 2 +- .../functions/scoreboards/delscore.mcfunction | 1 + .../digcounter/digtrigger.mcfunction | 2 + ...unter.mcfunction => setdisplay.mcfunction} | 2 +- .../digcounter/tools/golaxe.mcfunction | 2 +- .../digcounter/toolsfix.mcfunction | 6 +- ...unter.mcfunction => setdisplay.mcfunction} | 0 .../functions/scoreboards/install.mcfunction | 19 +- ...unter.mcfunction => setdisplay.mcfunction} | 2 +- data/fz/functions/scoreboards/main.mcfunction | 15 +- .../tradingcounter/calculator.mcfunction | 2 +- ...unter.mcfunction => setdisplay.mcfunction} | 2 +- .../scoreboards/uninstall.mcfunction | 2 + data/fz/functions/start.mcfunction | 6 +- data/fz/functions/sweeper/install.mcfunction | 2 +- .../fz/functions/sweeper/uninstall.mcfunction | 2 +- data/fz/functions/uninstall.mcfunction | 2 +- data/fz/functions/update.mcfunction | 14 +- data/minecraft/tags/functions/load.json | 2 +- data/minecraft/tags/functions/tick.json | 3 +- here.sc | 40 +- restore_scores.sc | 6 +- tagplayer.sc | 2462 +++++++++-------- 52 files changed, 1523 insertions(+), 1844 deletions(-) create mode 100644 data/fz/advancements/scoreboards/bedrockbreaked.json rename data/fz/functions/scoreboards/activation/{activation.mcfunction => setdisplay.mcfunction} (99%) create mode 100644 data/fz/functions/scoreboards/bedrockbreaked/calculator.mcfunction create mode 100644 data/fz/functions/scoreboards/bedrockbreaked/setdisplay.mcfunction rename data/fz/functions/scoreboards/damagetaken/{damagetaken.mcfunction => setdisplay.mcfunction} (99%) rename data/fz/functions/scoreboards/deathcounter/{deathcounter.mcfunction => setdisplay.mcfunction} (99%) rename data/fz/functions/scoreboards/digcounter/{digcounter.mcfunction => setdisplay.mcfunction} (99%) rename data/fz/functions/scoreboards/fishingcounter/{fishingcounter.mcfunction => setdisplay.mcfunction} (100%) rename data/fz/functions/scoreboards/killcounter/{killcounter.mcfunction => setdisplay.mcfunction} (99%) rename data/fz/functions/scoreboards/tradingcounter/{tradingcounter.mcfunction => setdisplay.mcfunction} (99%) diff --git a/LICENSE b/LICENSE index f288702..94a9ed0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found. GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. @@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see -. +. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -. +. diff --git a/README.md b/README.md index 7067c1b..a5755dc 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ # FZ-sDataPack A Minecraft Datapack -#### @Author: Harveykang +#### @Author: Harvey_Husky #### This project is licensed under the terms of the GNU General Public License v3.0. -#### Copyright (C)2019-2020 Harvey.Kang +#### Copyright (C)2019-2020 Harvey_Husky -# 请移步国内平台:https://gitee.com/harvey-husky/FZ-sDatapack/releases - -### v2.0.0 +### v2.0.2 - 支持Minecraft1.16.x - 抬头并按一下shift来打开设置界面 - 提供一些地毯脚本:*请在升级数据包的同时替换这些工具!!* @@ -25,8 +23,9 @@ A Minecraft Datapack - “/s”修改玩家模式为生存模式 - tagplayer.sc: - 这个工具可以防止将地毯mod生成的假人计入记分板 + - 可以通过自定义文件名来自定义游戏内命令 - 使用方法: - - 输入“/scripts load tagplayer”加载工具 + - 输入“/script load tagplayer”加载工具 - 包含全部地毯假人自带的功能,以及新功能,如: - “/tagplayer check xxx”检查玩家的状态 - “/tagplayer checkall”检查所有玩家的状态 @@ -38,12 +37,35 @@ A Minecraft Datapack - 悄悄说一句没白名单的服把usercache.json复制一份改成whitelist.json就可以啦 - 注意:原有的记分板会被删除 - 使用方法: - - 输入“/scripts load restore_scores”加载工具 + - 输入“/script load restore_scores”加载工具 - 输入“/restore_scores by_whitelist”开始恢复 - - 输入“/scripts unload restore_scores”卸载工具 + - 输入“/script unload restore_scores”卸载工具 - 记得用完就删掉它! +- 无需配置即可支持该铁头功破基岩榜Mod:https://gitee.com/harvey-husky/FZ-BBL/releases + - 破基岩榜的分数和订阅设置会在铁头功记分板的总分大于0时显示,以免未添加该mod的服务器显示破基岩榜 - 计划 - 添加单独的记分板升级工具 +##### v2.0.3 +- 修复在不添加tagplayer工具时记分板不加分的bug +##### v2.0.2 +- 修复在使用carpet-1.4.22或以上版本时,tagplayer的玩家名错乱的bug +##### v2.0.1.8 +- 修复使用金斧头挖掘会导致总量+2的bug +- 修复使用金锄头挖掘不会给挖掘榜加分 +- 修复主手有铲子,斧头,锄头时,副手放置方块会导致挖掘榜-1的bug(原版bug,通过toolsfix2成就修复) +##### v2.0.1.7 +- 修复有时设置界面打不开的bug +- 修复交易榜只加一次分的bug.. +- 修复tagplayer中的事件多次触发的bug +##### v2.0.1.6 +- tagplayer现在可以通过自定义文件名来自定义游戏内命令 +- 修复铁制工具依然不统计记分板的bug... +##### v2.0.1.3 +- 修复部分铁质工具不统计挖掘榜的bug +##### v2.0.1.1 +- 为设置界面的计分板添加悬浮文本 +- 无需配置即可支持该铁头功破基岩榜Mod:https://gitee.com/harvey-husky/FZ-BBL/releases + - 破基岩榜的分数和订阅设置会在铁头功记分板的总分大于0时显示,以免未添加该mod的服务器显示破基岩榜 ##### v2.0.0.11 - “/tagplayer spawn xxx”后面现在可以追加“at”、“facing”、“in”参数 ##### v2.0.0.10 diff --git a/data/fz/advancements/leavegame.json b/data/fz/advancements/leavegame.json index bcc6f32..b52bc49 100644 --- a/data/fz/advancements/leavegame.json +++ b/data/fz/advancements/leavegame.json @@ -11,7 +11,6 @@ "entity": "this", "scores": { "leaveGame": { - "min": -2147483648, "max": 0 } } diff --git a/data/fz/advancements/scoreboards/bedrockbreaked.json b/data/fz/advancements/scoreboards/bedrockbreaked.json new file mode 100644 index 0000000..c7b54e5 --- /dev/null +++ b/data/fz/advancements/scoreboards/bedrockbreaked.json @@ -0,0 +1,23 @@ +{ + "criteria": { + "damage_taken": { + "trigger": "minecraft:tick", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "fz.bbl": { + "min": 1 + } + } + } + ] + } + } + }, + "rewards": { + "function": "fz:scoreboards/bedrockbreaked/calculator" + } +} \ No newline at end of file diff --git a/data/fz/advancements/scoreboards/damagetaken.json b/data/fz/advancements/scoreboards/damagetaken.json index 8159cc3..783a077 100644 --- a/data/fz/advancements/scoreboards/damagetaken.json +++ b/data/fz/advancements/scoreboards/damagetaken.json @@ -9,8 +9,7 @@ "entity": "this", "scores": { "10xDamageTaken": { - "min": 1, - "max": 2147483647 + "min": 1 } } } diff --git a/data/fz/advancements/scoreboards/deathcounter.json b/data/fz/advancements/scoreboards/deathcounter.json index daef441..af2b7e4 100644 --- a/data/fz/advancements/scoreboards/deathcounter.json +++ b/data/fz/advancements/scoreboards/deathcounter.json @@ -9,8 +9,7 @@ "entity": "this", "scores": { "deathTester": { - "min": 1, - "max": 2147483647 + "min": 1 } } } diff --git a/data/fz/advancements/scoreboards/digcounter/digtrigger.json b/data/fz/advancements/scoreboards/digcounter/digtrigger.json index 80a294a..10de185 100644 --- a/data/fz/advancements/scoreboards/digcounter/digtrigger.json +++ b/data/fz/advancements/scoreboards/digcounter/digtrigger.json @@ -11,8 +11,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedWooShovel": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -21,8 +20,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedWooPickaxe": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -31,8 +29,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedWooHoe": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -41,8 +38,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedWooAxe": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -51,8 +47,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedStoShovel": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -61,8 +56,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedStoPickaxe": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -71,8 +65,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedStoHoe": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -81,8 +74,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedStoAxe": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -91,8 +83,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedNetShovel": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -101,8 +92,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedNetPickaxe": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -111,8 +101,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedNetHoe": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -121,8 +110,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedNetAxe": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -131,8 +119,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedIroShovel": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -141,8 +128,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedIroPickaxe": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -151,8 +137,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedIroHoe": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -161,8 +146,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedIroAxe": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -171,8 +155,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedGolShovel": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -181,8 +164,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedGolPickaxe": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -190,9 +172,8 @@ { "condition": "minecraft:entity_scores", "scores": { - "usedDiaHoe": { - "min": 1, - "max": 2147483647 + "usedGolHoe": { + "min": 1 } }, "entity": "this" @@ -201,8 +182,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedGolAxe": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -211,8 +191,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedDiaShovel": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -221,8 +200,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedDiaPickaxe": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -231,8 +209,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedDiaHoe": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -241,8 +218,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedDiaAxe": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" @@ -251,8 +227,7 @@ "condition": "minecraft:entity_scores", "scores": { "usedShears": { - "min": 1, - "max": 2147483647 + "min": 1 } }, "entity": "this" diff --git a/data/fz/advancements/scoreboards/digcounter/toolsfix.json b/data/fz/advancements/scoreboards/digcounter/toolsfix.json index 80ec234..0fba25b 100644 --- a/data/fz/advancements/scoreboards/digcounter/toolsfix.json +++ b/data/fz/advancements/scoreboards/digcounter/toolsfix.json @@ -1,484 +1,57 @@ { "criteria": { - "used_axe_on_block": { + "right_click_tools": { "trigger": "minecraft:item_used_on_block", "conditions": { - "player": [ - { - "condition": "minecraft:alternative", - "terms": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:diamond_axe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:iron_axe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:stone_axe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:wooden_axe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:golden_axe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:netherite_axe" - } - } - } - } + "item": { + "items": [ + "golden_axe", + "golden_hoe", + "golden_shovel", + "wooden_axe", + "wooden_hoe", + "wooden_shovel", + "diamond_axe", + "diamond_hoe", + "diamond_shovel", + "iron_axe", + "iron_hoe", + "iron_shovel", + "stone_axe", + "stone_hoe", + "stone_shovel", + "netherite_axe", + "netherite_hoe", + "netherite_shovel" + ] + }, + "location": { + "block": { + "blocks": [ + "dirt_path", + "farmland", + "oak_log", + "stripped_birch_log", + "stripped_acacia_log", + "stripped_jungle_log", + "stripped_spruce_log", + "stripped_dark_oak_log", + "stripped_warped_stem", + "stripped_crimson_stem", + "stripped_oak_wood", + "stripped_birch_wood", + "stripped_acacia_wood", + "stripped_jungle_wood", + "stripped_spruce_wood", + "stripped_dark_oak_wood", + "stripped_warped_hyphae", + "stripped_crimson_hyphae" ] } - ] - } - }, - "attacked_with_axe": { - "trigger": "minecraft:player_hurt_entity", - "conditions": { - "player": [ - { - "condition": "minecraft:alternative", - "terms": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:diamond_axe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:iron_axe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:stone_axe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:wooden_axe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:golden_axe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:netherite_axe" - } - } - } - } - ] - } - ] - } - }, - "used_shovel_on_block": { - "trigger": "minecraft:item_used_on_block", - "conditions": { - "player": [ - { - "condition": "minecraft:alternative", - "terms": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:diamond_shovel" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:iron_shovel" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:stone_shovel" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:wooden_shovel" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:golden_shovel" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:netherite_shovel" - } - } - } - } - ] - } - ] - } - }, - "attacked_with_shovel": { - "trigger": "minecraft:player_hurt_entity", - "conditions": { - "player": [ - { - "condition": "minecraft:alternative", - "terms": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:diamond_shovel" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:iron_shovel" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:stone_shovel" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:wooden_shovel" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:golden_shovel" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:netherite_shovel" - } - } - } - } - ] - } - ] - } - }, - "used_hoe_on_block": { - "trigger": "minecraft:item_used_on_block", - "conditions": { - "player": [ - { - "condition": "minecraft:alternative", - "terms": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:diamond_hoe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:iron_hoe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:stone_hoe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:wooden_hoe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:golden_hoe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:netherite_hoe" - } - } - } - } - ] - } - ] - } - }, - "attacked_with_hoe": { - "trigger": "minecraft:player_hurt_entity", - "conditions": { - "player": [ - { - "condition": "minecraft:alternative", - "terms": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:diamond_hoe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:iron_hoe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:stone_hoe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:wooden_hoe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:golden_hoe" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "item": "minecraft:netherite_hoe" - } - } - } - } - ] - } - ] + } } } }, - "requirements": [ - [ - "used_axe_on_block", - "attacked_with_axe", - "used_shovel_on_block", - "attacked_with_shovel", - "used_hoe_on_block", - "attacked_with_hoe" - ] - ], "rewards": { "function": "fz:scoreboards/digcounter/toolsfix" } diff --git a/data/fz/advancements/scoreboards/fishingcounter.json b/data/fz/advancements/scoreboards/fishingcounter.json index 0759ba8..a8e658d 100644 --- a/data/fz/advancements/scoreboards/fishingcounter.json +++ b/data/fz/advancements/scoreboards/fishingcounter.json @@ -9,8 +9,7 @@ "entity": "this", "scores": { "fishingTester": { - "min": 1, - "max": 2147483647 + "min": 1 } } } diff --git a/data/fz/functions/carpet/carpet.mcfunction b/data/fz/functions/carpet/carpet.mcfunction index be46b66..315580e 100644 --- a/data/fz/functions/carpet/carpet.mcfunction +++ b/data/fz/functions/carpet/carpet.mcfunction @@ -1,5 +1,5 @@ #初始化tagplayer carpet setDefault commandScript true carpet setDefault commandScriptACE ops -carpet setDefault scriptsAutoload true -carpet setDefault commandPlayer ops \ No newline at end of file +script run carpet_rules = system_info('world_carpet_rules'); if(carpet_rules:'scriptsAutoload' != 'true', run('carpet setDefault scriptsAutoload true'); run('tellraw @a {"text":"[错误]假人插件未正确加载,已自动将“scriptsAutoload”设为true。正在重载,如仍未加载,请手动加载...", "color":"#ff6100"}'); run('reload')) +script unload player diff --git a/data/fz/functions/config/display.mcfunction b/data/fz/functions/config/display.mcfunction index 62d869b..a21007a 100644 --- a/data/fz/functions/config/display.mcfunction +++ b/data/fz/functions/config/display.mcfunction @@ -2,23 +2,26 @@ schedule function fz:config/timeout 300s #输出玩家可见的设置页面 ##扫地机 -execute if data storage fz.installed {sweeper:1b} run tellraw @s {"text": "扫地机:","color": "#ccff00"} +execute if data storage fz.installed {sweeper: 1b} run tellraw @s {"text": "扫地机:","color": "#ccff00"} ##扫地机时间,对应分数1478966210-1478966215 - execute if data storage fz.installed {sweeper:1b} run tellraw @s [{"text": "- "},{"text": "[关]","color": "#00ff00","clickEvent": {"action": "run_command","value": "/trigger config set 1478966210"}},{"text": "[30秒]","color": "#5fff00","clickEvent": {"action": "run_command","value": "/trigger config set 1478966211"}},{"text": "[1分钟]","color": "#d7ff00","clickEvent": {"action": "run_command","value": "/trigger config set 1478966212"}},{"text": "[2分钟]","color": "#ffd900","clickEvent": {"action": "run_command","value": "/trigger config set 1478966213"}},{"text": "[3分钟]","color": "#ff6100","clickEvent": {"action": "run_command","value": "/trigger config set 1478966214"}},{"text": "[4分钟]","color": "#ff0000","clickEvent": {"action": "run_command","value": "/trigger config set 1478966215"}}] + execute if data storage fz.installed {sweeper: 1b} run tellraw @s [{"text": "- "},{"text": "[关]","color": "#00ff00","clickEvent": {"action": "run_command","value": "/trigger config set 1478966210"}},{"text": "[30秒]","color": "#5fff00","clickEvent": {"action": "run_command","value": "/trigger config set 1478966211"}},{"text": "[1分钟]","color": "#d7ff00","clickEvent": {"action": "run_command","value": "/trigger config set 1478966212"}},{"text": "[2分钟]","color": "#ffd900","clickEvent": {"action": "run_command","value": "/trigger config set 1478966213"}},{"text": "[3分钟]","color": "#ff6100","clickEvent": {"action": "run_command","value": "/trigger config set 1478966214"}},{"text": "[4分钟]","color": "#ff0000","clickEvent": {"action": "run_command","value": "/trigger config set 1478966215"}}] ##开启矿车白名单1478966216 - execute if data storage fz.installed {sweeper:1b} unless score keepMinecart parameter matches 1 run tellraw @s [{"text": "- "},{"text": "矿车白名单:","color": "#8c8f91"},{"text": "[已关闭]","color": "#ff0000","clickEvent": {"action": "run_command","value": "/trigger config set 1478966216"}}] + execute if data storage fz.installed {sweeper: 1b} unless score keepMinecart parameter matches 1 run tellraw @s [{"text": "- "},{"text": "矿车白名单:","color": "#8c8f91"},{"text": "[已关闭]","color": "#ff0000","clickEvent": {"action": "run_command","value": "/trigger config set 1478966216"}}] ##关闭矿车白名单1478966217 - execute if data storage fz.installed {sweeper:1b} if score keepMinecart parameter matches 1 run tellraw @s [{"text": "- "},{"text": "矿车白名单:","color": "#8c8f91"},{"text": "[已开启]","color": "#00ff00","clickEvent": {"action": "run_command","value": "/trigger config set 1478966217"}}] + execute if data storage fz.installed {sweeper: 1b} if score keepMinecart parameter matches 1 run tellraw @s [{"text": "- "},{"text": "矿车白名单:","color": "#8c8f91"},{"text": "[已开启]","color": "#00ff00","clickEvent": {"action": "run_command","value": "/trigger config set 1478966217"}}] ##声音提示 - execute if data storage fz.installed {sweeper:1b} run tellraw @s[tag=!fz.sweeperSoundOff] [{"text": "- "},{"text": "声音:","color": "#8c8f91"},{"text": "[已开启]","color": "#00ff00","clickEvent": {"action": "run_command","value": "/trigger config set 1478966209"}}] - execute if data storage fz.installed {sweeper:1b} run tellraw @s[tag=fz.sweeperSoundOff] [{"text": "- "},{"text": "声音:","color": "#8c8f91"},{"text": "[已关闭]","color": "#ff0000","clickEvent": {"action": "run_command","value": "/trigger config set 1478966208"}}] + execute if data storage fz.installed {sweeper: 1b} run tellraw @s[tag=!fz.sweeperSoundOff] [{"text": "- "},{"text": "声音:","color": "#8c8f91"},{"text": "[已开启]","color": "#00ff00","clickEvent": {"action": "run_command","value": "/trigger config set 1478966209"}}] + execute if data storage fz.installed {sweeper: 1b} run tellraw @s[tag=fz.sweeperSoundOff] [{"text": "- "},{"text": "声音:","color": "#8c8f91"},{"text": "[已关闭]","color": "#ff0000","clickEvent": {"action": "run_command","value": "/trigger config set 1478966208"}}] ##消息提示 - execute if data storage fz.installed {sweeper:1b} run tellraw @s[tag=!fz.sweeperMessageOff] [{"text": "- "},{"text": "消息:","color": "#8c8f91"},{"text": "[已开启]","color": "#00ff00","clickEvent": {"action": "run_command","value": "/trigger config set 1478966205"}}] - execute if data storage fz.installed {sweeper:1b} run tellraw @s[tag=fz.sweeperMessageOff] [{"text": "- "},{"text": "消息:","color": "#8c8f91"},{"text": "[已关闭]","color": "#ff0000","clickEvent": {"action": "run_command","value": "/trigger config set 1478966204"}}] + execute if data storage fz.installed {sweeper: 1b} run tellraw @s[tag=!fz.sweeperMessageOff] [{"text": "- "},{"text": "消息:","color": "#8c8f91"},{"text": "[已开启]","color": "#00ff00","clickEvent": {"action": "run_command","value": "/trigger config set 1478966205"}}] + execute if data storage fz.installed {sweeper: 1b} run tellraw @s[tag=fz.sweeperMessageOff] [{"text": "- "},{"text": "消息:","color": "#8c8f91"},{"text": "[已关闭]","color": "#ff0000","clickEvent": {"action": "run_command","value": "/trigger config set 1478966204"}}] ##血条栏提示 - execute if data storage fz.installed {sweeper:1b} run tellraw @s[tag=!fz.sweeperBossbarOff] [{"text": "- "},{"text": "血条栏:","color": "#8c8f91"},{"text": "[已开启]","color": "#00ff00","clickEvent": {"action": "run_command","value": "/trigger config set 1478966207"}}] - execute if data storage fz.installed {sweeper:1b} run tellraw @s[tag=fz.sweeperBossbarOff] [{"text": "- "},{"text": "血条栏:","color": "#8c8f91"},{"text": "[已关闭]","color": "#ff0000","clickEvent": {"action": "run_command","value": "/trigger config set 1478966206"}}] + execute if data storage fz.installed {sweeper: 1b} run tellraw @s[tag=!fz.sweeperBossbarOff] [{"text": "- "},{"text": "血条栏:","color": "#8c8f91"},{"text": "[已开启]","color": "#00ff00","clickEvent": {"action": "run_command","value": "/trigger config set 1478966207"}}] + execute if data storage fz.installed {sweeper: 1b} run tellraw @s[tag=fz.sweeperBossbarOff] [{"text": "- "},{"text": "血条栏:","color": "#8c8f91"},{"text": "[已关闭]","color": "#ff0000","clickEvent": {"action": "run_command","value": "/trigger config set 1478966206"}}] ##记分板 -execute if data storage fz.installed {scoreboards:1b} run tellraw @s {"text": "记分板:","color": "#ccff00"} +execute if data storage fz.installed {scoreboards: 1b} run tellraw @s {"text": "记分板:","color": "#ccff00"} ##计分板显示,对应分数1838019370-1838019379 - execute if data storage fz.installed {scoreboards:1b} run tellraw @s [{"text": "- "},{"text": "[关]","color": "#ff0000","clickEvent": {"action": "run_command","value": "/trigger config set 1838019370"}},{"text": "[轮播]","color": "gold","clickEvent": {"action": "run_command","value": "/trigger config set 1838019371"}},{"text": "[总量]","color": "dark_aqua","clickEvent": {"action": "run_command","value": "/trigger config set 1838019379"}},{"text": "[在线时间(h)]","color": "aqua","clickEvent": {"action": "run_command","value": "/trigger config set 1838019372"}},{"text": "[抖M名单]","color": "yellow","clickEvent": {"action": "run_command","value": "/trigger config set 1838019373"}},{"text": "[死亡榜]","color": "dark_red","clickEvent": {"action": "run_command","value": "/trigger config set 1838019374"}},{"text": "[挖掘榜]","color": "gray","clickEvent": {"action": "run_command","value": "/trigger config set 1838019375"}},{"text": "[钩直饵咸]","color": "blue","clickEvent": {"action": "run_command","value": "/trigger config set 1838019376"}},{"text": "[击杀榜]","color": "red","clickEvent": {"action": "run_command","value": "/trigger config set 1838019377"}},{"text": "[交♂易榜]","color": "green","clickEvent": {"action": "run_command","value": "/trigger config set 1838019378"}}] \ No newline at end of file + 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"}}] + ##计分板显示,对应分数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"}}] diff --git a/data/fz/functions/config/install.mcfunction b/data/fz/functions/config/install.mcfunction index 7a5d4a4..d9b5356 100644 --- a/data/fz/functions/config/install.mcfunction +++ b/data/fz/functions/config/install.mcfunction @@ -2,7 +2,7 @@ #初始化触发器记分板 scoreboard objectives add config trigger #存入已安装信息 -data merge storage fz.installed {config:1b} +data merge storage fz.installed {config: 1b} #提示已安装 tellraw @a {"text": "[信息]设置功能已安装","color": "#5fff00"} #开始运行 diff --git a/data/fz/functions/config/main.mcfunction b/data/fz/functions/config/main.mcfunction index 40acbe9..7dde148 100644 --- a/data/fz/functions/config/main.mcfunction +++ b/data/fz/functions/config/main.mcfunction @@ -2,7 +2,7 @@ #允许玩家操作config记分板 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 1838019370..1838019379 run function fz:scoreboards/config +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 #循环执行本函数 -schedule function fz:config/main 1 \ No newline at end of file +schedule function fz:config/main 1t \ No newline at end of file diff --git a/data/fz/functions/config/start.mcfunction b/data/fz/functions/config/start.mcfunction index 3a4d241..4ec825f 100644 --- a/data/fz/functions/config/start.mcfunction +++ b/data/fz/functions/config/start.mcfunction @@ -3,5 +3,7 @@ schedule clear fz:config/main schedule clear fz:config/timeout data remove storage fz.config is_open scoreboard players enable @a config +advancement revoke @a only fz:config/sneak +advancement revoke @a only fz:config/unsneak #测试用的输出 tellraw @a {"text": "[信息]设置功能已启用","color": "#5fff00"} \ No newline at end of file diff --git a/data/fz/functions/config/turnon.mcfunction b/data/fz/functions/config/turnon.mcfunction index 235d566..f322ebc 100644 --- a/data/fz/functions/config/turnon.mcfunction +++ b/data/fz/functions/config/turnon.mcfunction @@ -2,9 +2,9 @@ #重置玩家的config分数,避免开启设置功能后,由于该玩家先前的分数而直接运行某些功能 scoreboard players reset @s config #判断设置功能是否已经开启,如果未开启则运行主函数 -execute unless data storage fz.config {is_open:1b} run function fz:config/main -execute unless data storage fz.config {is_open:1b} run scoreboard objectives add openingConfig dummy -execute unless data storage fz.config {is_open:1b} run data merge storage fz.config {is_open:1b} +execute unless data storage fz.config {is_open: 1b} run function fz:config/main +execute unless data storage fz.config {is_open: 1b} run scoreboard objectives add openingConfig dummy +execute unless data storage fz.config {is_open: 1b} run data merge storage fz.config {is_open: 1b} #将该玩家加入打开设置页面的玩家的列表 scoreboard players set @s openingConfig 1 #将设置内容输出给玩家 diff --git a/data/fz/functions/config/uninstall.mcfunction b/data/fz/functions/config/uninstall.mcfunction index affb5f5..1bd213a 100644 --- a/data/fz/functions/config/uninstall.mcfunction +++ b/data/fz/functions/config/uninstall.mcfunction @@ -4,6 +4,6 @@ schedule clear fz:config/main schedule clear fz:config/timeout data remove storage fz.config is_open #写入已卸载的信息 -data merge storage fz.installed {config:0b} +data merge storage fz.installed {config: 0b} #提示已卸载 tellraw @a {"text": "[信息]设置功能已卸载","color": "#5fff00"} \ No newline at end of file diff --git a/data/fz/functions/config/unsneak.mcfunction b/data/fz/functions/config/unsneak.mcfunction index 6930aa9..e2cb0ce 100644 --- a/data/fz/functions/config/unsneak.mcfunction +++ b/data/fz/functions/config/unsneak.mcfunction @@ -1,6 +1,6 @@ #由config/sneak和config/unsneak成就触发 #判断玩家视角是否指向正上方,是则运行turnon函数 -execute if data storage fz.installed {config:1b} if entity @s[x_rotation=-90] run function fz:config/turnon +execute if data storage fz.installed {config: 1b} if entity @s[x_rotation=-90] run function fz:config/turnon #重置该玩家的两个成就 advancement revoke @s only fz:config/sneak advancement revoke @s only fz:config/unsneak \ No newline at end of file diff --git a/data/fz/functions/health/install.mcfunction b/data/fz/functions/health/install.mcfunction index fcaf0e9..a35a56b 100644 --- a/data/fz/functions/health/install.mcfunction +++ b/data/fz/functions/health/install.mcfunction @@ -5,6 +5,6 @@ scoreboard objectives modify Health rendertype hearts scoreboard objectives setdisplay list Health scoreboard objectives setdisplay belowName Health #写入已安装的信息 -data merge storage fz.installed {health:1b} +data merge storage fz.installed {health: 1b} #提示已安装 tellraw @a {"text": "[信息]血量显示已安装","color": "#5fff00"} \ No newline at end of file diff --git a/data/fz/functions/health/uninstall.mcfunction b/data/fz/functions/health/uninstall.mcfunction index 92a78bc..d709f66 100644 --- a/data/fz/functions/health/uninstall.mcfunction +++ b/data/fz/functions/health/uninstall.mcfunction @@ -2,6 +2,6 @@ #删除计分板 scoreboard objectives remove Health #写入已卸载的信息 -data merge storage fz.installed {health:0b} +data merge storage fz.installed {health: 0b} #提示已卸载 tellraw @a {"text": "[信息]血量显示已卸载","color": "#5fff00"} \ No newline at end of file diff --git a/data/fz/functions/install.mcfunction b/data/fz/functions/install.mcfunction index 103959b..c7f8a30 100644 --- a/data/fz/functions/install.mcfunction +++ b/data/fz/functions/install.mcfunction @@ -15,12 +15,12 @@ function fz:health/install function fz:login/logintips/install function fz:carpet/carpet #版本信息 -data merge storage fz.installed {installed:1b} -data merge storage fz {version:Beta-2.0.0.11} -data merge storage fz {date:2020-12.28} -data merge storage fz {time:"18:01"} -data merge storage fz {snapshot:-SNAPSHOT} -##data remove storage fz snapshot +data merge storage fz.installed {installed: 1b} +data merge storage fz {version: 2.1.0} +data merge storage fz {date: 2020-7.1} +data merge storage fz {time: "02:43"} +##data merge storage fz {snapshot: -SNAPSHOT} +data remove storage fz snapshot tellraw @a {"text": "[信息]启动完毕","color": "#5fff00"} #提示已安装 tellraw @a {"text": "[信息]安装完成!","color": "#5fff00"} diff --git a/data/fz/functions/load.mcfunction b/data/fz/functions/load.mcfunction index a538a00..eb1992c 100644 --- a/data/fz/functions/load.mcfunction +++ b/data/fz/functions/load.mcfunction @@ -1,8 +1,8 @@ #如果未安装且未卸载则安装 -execute unless data storage fz.installed {installed:1b} unless data storage fz.installed {installed:0b} run function fz:install +execute unless data storage fz.installed {installed: 1b} unless data storage fz.installed {installed: 0b} run function fz:install #如果版本正确且已安装则开始运行 -execute if data storage fz {version:Beta-2.0.0.11} if data storage fz.installed {installed:1b} run function fz:start +execute if data storage fz {version: 2.1.0} if data storage fz.installed {installed: 1b} run function fz:start #如果版本不符则更新 -execute unless data storage fz {version:Beta-2.0.0.11} run function fz:update +execute unless data storage fz {version: 2.1.0} run function fz:update #输出版本信息 tellraw @a [{"text": "[版本信息]FZ's Datapack-","color": "#ffd900"},{"nbt":"version","storage":"fz","color": "#ffd900"},{"nbt": "snapshot", "storage": "fz","color": "red"}] \ No newline at end of file diff --git a/data/fz/functions/login/logintips/install.mcfunction b/data/fz/functions/login/logintips/install.mcfunction index 0c7b5b9..48cdff3 100644 --- a/data/fz/functions/login/logintips/install.mcfunction +++ b/data/fz/functions/login/logintips/install.mcfunction @@ -1,4 +1,4 @@ #安装登陆提示 -data merge storage fz.installed {logintips:1b} +data merge storage fz.installed {logintips: 1b} #提示已安装 tellraw @a {"text": "[信息]登陆提示已安装","color": "#5fff00"} \ No newline at end of file diff --git a/data/fz/functions/login/logintips/uninstall.mcfunction b/data/fz/functions/login/logintips/uninstall.mcfunction index ad8c84f..5b383c3 100644 --- a/data/fz/functions/login/logintips/uninstall.mcfunction +++ b/data/fz/functions/login/logintips/uninstall.mcfunction @@ -1,4 +1,4 @@ #卸载登陆提示 -data merge storage fz.installed {logintips:0b} +data merge storage fz.installed {logintips: 0b} #提示已卸载 tellraw @a {"text": "[信息]登陆提示已卸载","color": "#5fff00"} \ No newline at end of file diff --git a/data/fz/functions/login/onlogin.mcfunction b/data/fz/functions/login/onlogin.mcfunction index 9897dba..d645c31 100644 --- a/data/fz/functions/login/onlogin.mcfunction +++ b/data/fz/functions/login/onlogin.mcfunction @@ -1,4 +1,4 @@ -execute if data storage fz.installed {logintips:1b} run tellraw @s {"text": "[提醒]站在地面,抬头并按一下shift即可打开设置页面","color": "#66ffff"} +execute if data storage fz.installed {logintips: 1b} run tellraw @s {"text": "[提醒]站在地面,抬头并按一下shift即可打开设置页面","color": "#66ffff"} scoreboard players set @s leaveGame 0 @@ -10,5 +10,7 @@ advancement revoke @s only fz:scoreboards/killcounter advancement revoke @s only fz:scoreboards/tradingcounter advancement revoke @s only fz:scoreboards/digcounter/digtrigger advancement revoke @s only fz:scoreboards/digcounter/toolsfix +advancement revoke @s only fz:config/sneak +advancement revoke @s only fz:config/unsneak advancement revoke @s from fz:leavegame \ No newline at end of file diff --git a/data/fz/functions/scoreboards/activation/activation.mcfunction b/data/fz/functions/scoreboards/activation/setdisplay.mcfunction similarity index 99% rename from data/fz/functions/scoreboards/activation/activation.mcfunction rename to data/fz/functions/scoreboards/activation/setdisplay.mcfunction index 558fd2a..1076882 100644 --- a/data/fz/functions/scoreboards/activation/activation.mcfunction +++ b/data/fz/functions/scoreboards/activation/setdisplay.mcfunction @@ -1,2 +1,2 @@ -#将在线时间榜显示给轮播计分板的队伍(金队) +#将在线时间榜显示给轮播计分板的队伍(金队) scoreboard objectives setdisplay sidebar.team.gold activation \ No newline at end of file diff --git a/data/fz/functions/scoreboards/bedrockbreaked/calculator.mcfunction b/data/fz/functions/scoreboards/bedrockbreaked/calculator.mcfunction new file mode 100644 index 0000000..11fb9ec --- /dev/null +++ b/data/fz/functions/scoreboards/bedrockbreaked/calculator.mcfunction @@ -0,0 +1,8 @@ +#计算受破基岩量和总榜 +#判断条件用于排除地毯小人 +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 +#重置触发该函数的成就 +advancement revoke @s only fz:scoreboards/bedrockbreaked \ No newline at end of file diff --git a/data/fz/functions/scoreboards/bedrockbreaked/setdisplay.mcfunction b/data/fz/functions/scoreboards/bedrockbreaked/setdisplay.mcfunction new file mode 100644 index 0000000..19ce500 --- /dev/null +++ b/data/fz/functions/scoreboards/bedrockbreaked/setdisplay.mcfunction @@ -0,0 +1,2 @@ +#将破基岩榜显示给轮播计分板的队伍(金队) +scoreboard objectives setdisplay sidebar.team.dark_gray bedrockBreaked \ No newline at end of file diff --git a/data/fz/functions/scoreboards/config.mcfunction b/data/fz/functions/scoreboards/config.mcfunction index 41a811f..9305fd1 100644 --- a/data/fz/functions/scoreboards/config.mcfunction +++ b/data/fz/functions/scoreboards/config.mcfunction @@ -1,4 +1,4 @@ -#应用计分板显示,对应分数1838019370-1838019379 +#应用计分板显示,对应分数1838019369-1838019379 execute if score @s config matches 1838019370 run team leave @s execute if score @s config matches 1838019371 run team join gold execute if score @s config matches 1838019372 run team join aqua @@ -9,6 +9,7 @@ execute if score @s config matches 1838019376 run team join blue 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 #每条子函数都要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/damagetaken/damagetaken.mcfunction b/data/fz/functions/scoreboards/damagetaken/setdisplay.mcfunction similarity index 99% rename from data/fz/functions/scoreboards/damagetaken/damagetaken.mcfunction rename to data/fz/functions/scoreboards/damagetaken/setdisplay.mcfunction index f17c6d6..28dc770 100644 --- a/data/fz/functions/scoreboards/damagetaken/damagetaken.mcfunction +++ b/data/fz/functions/scoreboards/damagetaken/setdisplay.mcfunction @@ -1,2 +1,2 @@ -#将抖M榜显示给轮播记分板的队伍(金队) +#将抖M榜显示给轮播记分板的队伍(金队) scoreboard objectives setdisplay sidebar.team.gold damageTaken \ No newline at end of file diff --git a/data/fz/functions/scoreboards/deathcounter/deathcounter.mcfunction b/data/fz/functions/scoreboards/deathcounter/setdisplay.mcfunction similarity index 99% rename from data/fz/functions/scoreboards/deathcounter/deathcounter.mcfunction rename to data/fz/functions/scoreboards/deathcounter/setdisplay.mcfunction index bd5d08f..9799976 100644 --- a/data/fz/functions/scoreboards/deathcounter/deathcounter.mcfunction +++ b/data/fz/functions/scoreboards/deathcounter/setdisplay.mcfunction @@ -1,2 +1,2 @@ -#将死亡榜显示给轮播计分板的队伍(金队) +#将死亡榜显示给轮播计分板的队伍(金队) scoreboard objectives setdisplay sidebar.team.gold deathCounter \ No newline at end of file diff --git a/data/fz/functions/scoreboards/delscore.mcfunction b/data/fz/functions/scoreboards/delscore.mcfunction index 47b261b..5dae1b1 100644 --- a/data/fz/functions/scoreboards/delscore.mcfunction +++ b/data/fz/functions/scoreboards/delscore.mcfunction @@ -7,5 +7,6 @@ scoreboard objectives remove fishingCounter scoreboard objectives remove damageTaken scoreboard objectives remove activation scoreboard objectives remove totalList +scoreboard objectives remove bedrockBreaked #提示已删除 tellraw @a {"text": "[信息]计分板数据已删除","color": "#5fff00"} \ No newline at end of file diff --git a/data/fz/functions/scoreboards/digcounter/digtrigger.mcfunction b/data/fz/functions/scoreboards/digcounter/digtrigger.mcfunction index 5092f28..a319a23 100644 --- a/data/fz/functions/scoreboards/digcounter/digtrigger.mcfunction +++ b/data/fz/functions/scoreboards/digcounter/digtrigger.mcfunction @@ -6,10 +6,12 @@ execute if score @s usedDiaPickaxe matches 1.. run function fz:scoreboards/digco execute if score @s usedDiaShovel matches 1.. run function fz:scoreboards/digcounter/tools/diashovel execute if score @s usedGolAxe matches 1.. run function fz:scoreboards/digcounter/tools/golaxe execute if score @s usedGolHoe matches 1.. run function fz:scoreboards/digcounter/tools/golhoe +execute if score @s usedGolHoe matches 1.. run kill @s execute if score @s usedGolPickaxe matches 1.. run function fz:scoreboards/digcounter/tools/golpickaxe execute if score @s usedGolShovel matches 1.. run function fz:scoreboards/digcounter/tools/golshovel execute if score @s usedIroAxe matches 1.. run function fz:scoreboards/digcounter/tools/iroaxe execute if score @s usedIroHoe matches 1.. run function fz:scoreboards/digcounter/tools/irohoe +execute if score @s usedIroHoe matches 1.. run kill @s execute if score @s usedIroPickaxe matches 1.. run function fz:scoreboards/digcounter/tools/iropickaxe execute if score @s usedIroShovel matches 1.. run function fz:scoreboards/digcounter/tools/iroshovel execute if score @s usedNetAxe matches 1.. run function fz:scoreboards/digcounter/tools/netaxe diff --git a/data/fz/functions/scoreboards/digcounter/digcounter.mcfunction b/data/fz/functions/scoreboards/digcounter/setdisplay.mcfunction similarity index 99% rename from data/fz/functions/scoreboards/digcounter/digcounter.mcfunction rename to data/fz/functions/scoreboards/digcounter/setdisplay.mcfunction index b5cffa8..6de8eff 100644 --- a/data/fz/functions/scoreboards/digcounter/digcounter.mcfunction +++ b/data/fz/functions/scoreboards/digcounter/setdisplay.mcfunction @@ -1,2 +1,2 @@ -#将挖掘榜显示给轮播记分板的队伍(金队) +#将挖掘榜显示给轮播记分板的队伍(金队) scoreboard objectives setdisplay sidebar.team.gold digCounter \ No newline at end of file diff --git a/data/fz/functions/scoreboards/digcounter/tools/golaxe.mcfunction b/data/fz/functions/scoreboards/digcounter/tools/golaxe.mcfunction index abfb0ff..2539d27 100644 --- a/data/fz/functions/scoreboards/digcounter/tools/golaxe.mcfunction +++ b/data/fz/functions/scoreboards/digcounter/tools/golaxe.mcfunction @@ -2,5 +2,5 @@ #判断条件用于排除地毯小人 execute unless score @s carpetBot matches 1 run scoreboard players operation @s digCounter += @s usedGolAxe execute unless score @s carpetBot matches 1 run scoreboard players operation 总挖掘量 digCounter += @s usedGolAxe -execute unless score @s carpetBot matches 1 run scoreboard players operation 总挖掘量 digCounter += @s usedGolAxe +execute unless score @s carpetBot matches 1 run scoreboard players operation 总挖掘量 totalList += @s usedGolAxe scoreboard players reset @s usedGolAxe \ No newline at end of file diff --git a/data/fz/functions/scoreboards/digcounter/toolsfix.mcfunction b/data/fz/functions/scoreboards/digcounter/toolsfix.mcfunction index 64ad2f5..9427f96 100644 --- a/data/fz/functions/scoreboards/digcounter/toolsfix.mcfunction +++ b/data/fz/functions/scoreboards/digcounter/toolsfix.mcfunction @@ -1,7 +1,7 @@ -#为digtrigger函数修正非挖掘的使用带来的加分 +#为digtrigger函数修正非挖掘的使用带来的加分(对一些方块使用工具) #判断条件用于排除地毯小人 execute unless score @s carpetBot matches 1 run scoreboard players remove @s digCounter 1 execute unless score @s carpetBot matches 1 run scoreboard players remove 总挖掘量 digCounter 1 execute unless score @s carpetBot matches 1 run scoreboard players remove 总挖掘量 totalList 1 -#重置探测右键使用工具的成就 -advancement revoke @s only fz:scoreboards/digcounter/toolsfix \ No newline at end of file +advancement revoke @s only fz:scoreboards/digcounter/toolsfix +#铲子和锄头的方块判断居然只响应产物不响应原方块,更离谱的是斧头两者会同时相应 \ No newline at end of file diff --git a/data/fz/functions/scoreboards/fishingcounter/fishingcounter.mcfunction b/data/fz/functions/scoreboards/fishingcounter/setdisplay.mcfunction similarity index 100% rename from data/fz/functions/scoreboards/fishingcounter/fishingcounter.mcfunction rename to data/fz/functions/scoreboards/fishingcounter/setdisplay.mcfunction diff --git a/data/fz/functions/scoreboards/install.mcfunction b/data/fz/functions/scoreboards/install.mcfunction index 876e308..1785bed 100644 --- a/data/fz/functions/scoreboards/install.mcfunction +++ b/data/fz/functions/scoreboards/install.mcfunction @@ -1,3 +1,4 @@ +scoreboard objectives add carpetBot dummy #在线时间计数器记分板,用于activation/main函数 scoreboard objectives add actimeCounter dummy @@ -8,9 +9,9 @@ scoreboard objectives add digCounter dummy scoreboard objectives add usedDiaShovel minecraft.used:minecraft.diamond_shovel scoreboard objectives add usedDiaHoe minecraft.used:minecraft.diamond_hoe scoreboard objectives add usedIroAxe minecraft.used:minecraft.iron_axe - scoreboard objectives add usedIroPickaxe minecraft.used:minecraft.iron_axe - scoreboard objectives add usedIroShovel minecraft.used:minecraft.iron_axe - scoreboard objectives add usedIroHoe minecraft.used:minecraft.iron_axe + scoreboard objectives add usedIroPickaxe minecraft.used:minecraft.iron_pickaxe + scoreboard objectives add usedIroShovel minecraft.used:minecraft.iron_shovel + scoreboard objectives add usedIroHoe minecraft.used:minecraft.iron_hoe scoreboard objectives add usedStoAxe minecraft.used:minecraft.stone_axe scoreboard objectives add usedStoPickaxe minecraft.used:minecraft.stone_pickaxe scoreboard objectives add usedStoShovel minecraft.used:minecraft.stone_shovel @@ -37,6 +38,8 @@ scoreboard objectives add damageTaken dummy scoreboard objectives add 10xDamageTaken minecraft.custom:damage_taken scoreboard objectives add activation dummy scoreboard objectives add totalList dummy +scoreboard objectives add bedrockBreaked dummy +scoreboard objectives add fz.bbl dummy scoreboard objectives modify activation displayname {"text": "活跃时间(h)","color": "aqua"} scoreboard objectives modify damageTaken displayname {"text": "抖M名单","color": "yellow"} @@ -46,6 +49,7 @@ scoreboard objectives modify fishingCounter displayname {"text": "钩直饵咸", scoreboard objectives modify killCounter displayname {"text": "击杀榜","color": "red"} 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"} team add gold team add aqua @@ -54,8 +58,9 @@ team add dark_red team add gray team add blue team add red -team add dark_aqua team add green +team add dark_aqua +team add dark_green team modify gold color gold team modify aqua color aqua team modify yellow color yellow @@ -65,6 +70,7 @@ team modify blue color blue 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 join aqua 总在线时间(h) team join yellow 群p抖M @@ -73,7 +79,8 @@ team join gray 总挖掘量 team join blue 总钓鱼数 team join red 总击杀数 team join green 总交♂易数 - +team join dark_green 全员头铁 +#各计分板的总量 scoreboard players operation 总在线时间(h) activation = 总在线时间(h) activation scoreboard players operation 群p抖M damageTaken = 群p抖M damageTaken scoreboard players operation 全部木大 deathCounter = 全部木大 deathCounter @@ -81,6 +88,7 @@ scoreboard players operation 总挖掘量 digCounter = 总挖掘量 digCounter scoreboard players operation 总钓鱼数 fishingCounter = 总钓鱼数 fishingCounter scoreboard players operation 总击杀数 killCounter = 总击杀数 killCounter scoreboard players operation 总交♂易数 tradingCounter = 总交♂易数 tradingCounter +#总榜的总量 scoreboard players operation 总在线时间(h) totalList = 总在线时间(h) totalList scoreboard players operation 群p抖M totalList = 群p抖M totalList scoreboard players operation 全部木大 totalList = 全部木大 totalList @@ -97,6 +105,7 @@ scoreboard objectives setdisplay sidebar.team.blue fishingCounter 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 data merge storage fz.installed {scoreboards:1b} diff --git a/data/fz/functions/scoreboards/killcounter/killcounter.mcfunction b/data/fz/functions/scoreboards/killcounter/setdisplay.mcfunction similarity index 99% rename from data/fz/functions/scoreboards/killcounter/killcounter.mcfunction rename to data/fz/functions/scoreboards/killcounter/setdisplay.mcfunction index b5cf7eb..05ede4c 100644 --- a/data/fz/functions/scoreboards/killcounter/killcounter.mcfunction +++ b/data/fz/functions/scoreboards/killcounter/setdisplay.mcfunction @@ -1,2 +1,2 @@ -#将击杀榜显示给轮播记分板的队伍(金队) +#将击杀榜显示给轮播记分板的队伍(金队) scoreboard objectives setdisplay sidebar.team.gold killCounter \ No newline at end of file diff --git a/data/fz/functions/scoreboards/main.mcfunction b/data/fz/functions/scoreboards/main.mcfunction index b6f6d59..dddbb42 100644 --- a/data/fz/functions/scoreboards/main.mcfunction +++ b/data/fz/functions/scoreboards/main.mcfunction @@ -1,9 +1,10 @@ function fz:scoreboards/killcounter/killcounter -schedule function fz:scoreboards/deathcounter/deathcounter 10s replace -schedule function fz:scoreboards/digcounter/digcounter 20s replace -schedule function fz:scoreboards/tradingcounter/tradingcounter 30s replace -schedule function fz:scoreboards/fishingcounter/fishingcounter 40s replace -schedule function fz:scoreboards/damagetaken/damagetaken 50s replace -schedule function fz:scoreboards/activation/activation 60s replace +schedule function fz:scoreboards/deathcounter/setdisplay 10s replace +schedule function fz:scoreboards/digcounter/setdisplay 20s replace +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 -schedule function fz:scoreboards/main 80s replace \ No newline at end of file +schedule function fz:scoreboards/bedrockbreaked/setdisplay 80s replace +schedule function fz:scoreboards/main 90s replace \ No newline at end of file diff --git a/data/fz/functions/scoreboards/tradingcounter/calculator.mcfunction b/data/fz/functions/scoreboards/tradingcounter/calculator.mcfunction index d6f1663..78a58d6 100644 --- a/data/fz/functions/scoreboards/tradingcounter/calculator.mcfunction +++ b/data/fz/functions/scoreboards/tradingcounter/calculator.mcfunction @@ -3,4 +3,4 @@ scoreboard players add @s tradingCounter 1 scoreboard players add 总交♂易数 tradingCounter 1 scoreboard players add 总交♂易数 totalList 1 #重置触发该函数的成就,地毯小人已在成就里排除 -advancement revoke @s only fz:tradingcounter \ No newline at end of file +advancement revoke @s only fz:scoreboards/tradingcounter \ No newline at end of file diff --git a/data/fz/functions/scoreboards/tradingcounter/tradingcounter.mcfunction b/data/fz/functions/scoreboards/tradingcounter/setdisplay.mcfunction similarity index 99% rename from data/fz/functions/scoreboards/tradingcounter/tradingcounter.mcfunction rename to data/fz/functions/scoreboards/tradingcounter/setdisplay.mcfunction index 0aa9238..3e4d637 100644 --- a/data/fz/functions/scoreboards/tradingcounter/tradingcounter.mcfunction +++ b/data/fz/functions/scoreboards/tradingcounter/setdisplay.mcfunction @@ -1,2 +1,2 @@ -#将交易榜显示给轮播记分板的队伍(金队) +#将交易榜显示给轮播记分板的队伍(金队) scoreboard objectives setdisplay sidebar.team.gold tradingCounter \ No newline at end of file diff --git a/data/fz/functions/scoreboards/uninstall.mcfunction b/data/fz/functions/scoreboards/uninstall.mcfunction index d5f078d..4d0e5b3 100644 --- a/data/fz/functions/scoreboards/uninstall.mcfunction +++ b/data/fz/functions/scoreboards/uninstall.mcfunction @@ -8,6 +8,7 @@ schedule clear fz:scoreboards/killcounter/killcounter schedule clear fz:scoreboards/tradingcounter/tradingcounter schedule clear fz:scoreboards/main +scoreboard objectives remove carpetBot scoreboard objectives remove actimeCounter scoreboard objectives remove usedDiaAxe @@ -34,6 +35,7 @@ scoreboard objectives remove usedNetAxe scoreboard objectives remove usedNetPickaxe scoreboard objectives remove usedNetShovel scoreboard objectives remove usedNetHoe +scoreboard objectives remove fz.bbl scoreboard objectives remove deathTester scoreboard objectives remove fishingTester diff --git a/data/fz/functions/start.mcfunction b/data/fz/functions/start.mcfunction index 3b9ff03..761cf37 100644 --- a/data/fz/functions/start.mcfunction +++ b/data/fz/functions/start.mcfunction @@ -1,7 +1,7 @@ #判断各功能是否已安装并运行 -execute if data storage fz.installed {scoreboards:1b} run function fz:scoreboards/start -execute if data storage fz.installed {sweeper:1b} run function fz:sweeper/start -execute if data storage fz.installed {config:1b} run function fz:config/start +execute if data storage fz.installed {scoreboards: 1b} run function fz:scoreboards/start +execute if data storage fz.installed {sweeper: 1b} run function fz:sweeper/start +execute if data storage fz.installed {config: 1b} run function fz:config/start function fz:carpet/carpet #测试用的输出 tellraw @a {"text": "[信息]启动完毕","color": "#5fff00"} \ No newline at end of file diff --git a/data/fz/functions/sweeper/install.mcfunction b/data/fz/functions/sweeper/install.mcfunction index 1f6ad3a..4705a8e 100644 --- a/data/fz/functions/sweeper/install.mcfunction +++ b/data/fz/functions/sweeper/install.mcfunction @@ -1,4 +1,4 @@ -data merge storage fz.installed {sweeper:1b} +data merge storage fz.installed {sweeper: 1b} bossbar add fz.sweeper {"text":"null"} bossbar set fz.sweeper value 0 #提示已安装 diff --git a/data/fz/functions/sweeper/uninstall.mcfunction b/data/fz/functions/sweeper/uninstall.mcfunction index 24aff0e..e19627a 100644 --- a/data/fz/functions/sweeper/uninstall.mcfunction +++ b/data/fz/functions/sweeper/uninstall.mcfunction @@ -12,6 +12,6 @@ schedule clear fz:sweeper/timer/2min schedule clear fz:sweeper/timer/3min schedule clear fz:sweeper/timer/4min -data merge storage fz.installed {sweeper:0b} +data merge storage fz.installed {sweeper: 0b} #提示已卸载 tellraw @a {"text": "[信息]扫地机已卸载","color": "#5fff00"} \ No newline at end of file diff --git a/data/fz/functions/uninstall.mcfunction b/data/fz/functions/uninstall.mcfunction index 39987ed..9f72e0b 100644 --- a/data/fz/functions/uninstall.mcfunction +++ b/data/fz/functions/uninstall.mcfunction @@ -9,6 +9,6 @@ scoreboard objectives remove parameter scoreboard objectives remove calculator scoreboard objectives remove leaveGame #存入已卸载信息,下次启动不会重新安装 -data merge storage fz.installed {installed:0b} +data merge storage fz.installed {installed: 0b} #提示已卸载 tellraw @a {"text": "[信息]FZ'sDatapack已卸载","color": "#5fff00"} \ No newline at end of file diff --git a/data/fz/functions/update.mcfunction b/data/fz/functions/update.mcfunction index daf75ce..6525bce 100644 --- a/data/fz/functions/update.mcfunction +++ b/data/fz/functions/update.mcfunction @@ -1,10 +1,12 @@ -#先安装 +#卸载 +function fz:uninstall +#安装 function fz:install #再卸载已经被卸载的项目 -execute if data storage fz.installed {config:0b} run function fz:config/uninstall -execute if data storage fz.installed {sweeper:0b} run function fz:sweeper/uninstall -execute if data storage fz.installed {scoreboards:0b} run function fz:scoreboards/uninstall -execute if data storage fz.installed {health:0b} run function fz:health/uninstall -execute if data storage fz.installed {logintips:0b} run function fz:login/logintips/uninstall +execute if data storage fz.installed {config: 0b} run function fz:config/uninstall +execute if data storage fz.installed {sweeper: 0b} run function fz:sweeper/uninstall +execute if data storage fz.installed {scoreboards: 0b} run function fz:scoreboards/uninstall +execute if data storage fz.installed {health: 0b} run function fz:health/uninstall +execute if data storage fz.installed {logintips: 0b} run function fz:login/logintips/uninstall #提示已安装 tellraw @a {"text": "[信息]升级完成","color": "#5fff00"} \ No newline at end of file diff --git a/data/minecraft/tags/functions/load.json b/data/minecraft/tags/functions/load.json index effaa90..d88c51a 100644 --- a/data/minecraft/tags/functions/load.json +++ b/data/minecraft/tags/functions/load.json @@ -1,5 +1,5 @@ { - "values": [ + "values": [ "fz:load" ] } \ No newline at end of file diff --git a/data/minecraft/tags/functions/tick.json b/data/minecraft/tags/functions/tick.json index 9c1fd7a..8aecd26 100644 --- a/data/minecraft/tags/functions/tick.json +++ b/data/minecraft/tags/functions/tick.json @@ -1,4 +1,3 @@ { - "values": [ - ] + "values": [] } \ No newline at end of file diff --git a/here.sc b/here.sc index c6b2895..015f6f0 100644 --- a/here.sc +++ b/here.sc @@ -5,17 +5,33 @@ __command() -> ( s_player = player(); pos = query(s_player, 'pos'); dim = query(s_player, 'dimension'); - scoreboard_add('here_pos_x'); - scoreboard_add('here_pos_y'); - scoreboard_add('here_pos_z'); - scoreboard('here_pos_x',s_player,round(get(pos, 0))); - scoreboard('here_pos_y',s_player,round(get(pos, 1))); - scoreboard('here_pos_z',s_player,round(get(pos, 2))); - run(str('tellraw @s [{"selector": "@s"},{"text":"说:我在[x:","color": "aqua"},{"score": {"objective": "here_pos_x","name": "%s"}},{"text": ", y:"},{"score": {"objective": "here_pos_y","name": "%s"}},{"text": ", z:"},{"score": {"objective": "here_pos_z","name": "%s"}},{"text": ", dim:%s]"}]', - s_player, s_player, s_player, dim - )); - scoreboard_remove('here_pos_x'); - scoreboard_remove('here_pos_y'); - scoreboard_remove('here_pos_z'); + if(dim == 'overworld', + ( + run(str('tellraw @a [{"selector": "@s"},{"text":"说: 我在主世界[x:%d, y:%d, z:%d, dim:overworld]","color": "aqua"}]', + round(pos:0), round(pos:1), round(pos:2) + )); + run(str('tellraw @a [{"text":"- 对应地狱: [x:%d, y:128, z:%d, dim:the_nether]","color": "aqua"}]', + round((pos:0)/8), round((pos:2)/8) + )) + ), + dim == 'the_nether', + ( + run(str('tellraw @a [{"selector": "@s"},{"text":"说: 我在下界[x:%d, y:%d, z:%d, dim:the_nether]","color": "aqua"}]', + round(pos:0), round(pos:1), round(pos:2) + )); + run(str('tellraw @a [{"text":"- 对应主世界: [x:%d, y:64, z:%d, dim:overworld]","color": "aqua"}]', + round((pos:0)*8), round((pos:2)*8) + )) + ), + dim == 'the_end', + ( + run(str('tellraw @a [{"selector": "@s"},{"text":"说: 我在末地[x:%d, y:%d, z:%d, dim:%s]","color": "aqua"}]', + round(pos:0), round(pos:1), round(pos:2), dim + )) + ), + run(str('tellraw @a [{"selector": "@s"},{"text":"说: 我在%s世界[x:%d, y:%d, z:%d, dim:%s]","color": "aqua"}]', + dim, round(pos:0), round(pos:1), round(pos:2), dim + )) + ); exit() ) \ No newline at end of file diff --git a/restore_scores.sc b/restore_scores.sc index ad5a70a..278520d 100644 --- a/restore_scores.sc +++ b/restore_scores.sc @@ -1,4 +1,4 @@ -global_version = '1.1.0'; +global_version = '1.1.1'; __config() -> { 'scope' -> 'global', 'stay_loaded' -> false @@ -128,7 +128,7 @@ __restore(pl, s_player) ->( total_traded = 0; total_hurt = 0; c_for(i = 0, i < length(pl), i += 1, - run('player ' + pl:i + ' spawn at ' + (s_player~'x'+0.1)+ ' ' +s_player~'y'+ ' ' +(s_player~'z'+0.1)); + run('player ' + pl:i + ' spawn'); game_tick(50); //活跃时间 actime = statistic(pl:i, 'custom', 'play_one_minute')/72000; @@ -184,7 +184,7 @@ __restore(pl, s_player) ->( scoreboard('activation', '总在线时间(h)', total_actime); scoreboard('totalList', '总在线时间(h)', total_actime); scoreboard('damageTaken', '群p抖M', total_hurt); - scoreboard('totalList', '群p抖M)', total_hurt); + scoreboard('totalList', '群p抖M', total_hurt); game_tick(50); run('function fz:scoreboards/install') ); diff --git a/tagplayer.sc b/tagplayer.sc index b5e5784..de228b2 100644 --- a/tagplayer.sc +++ b/tagplayer.sc @@ -1,1212 +1,1252 @@ -//************************************************************* -//************请将该文件放入"world\scripts"文件夹中************ -//************************************************************* -scoreboard_add('carpetBot'); -team_add('carpetBot'); -team_add('shadowedPlayer'); -team_property('carpetBot', 'prefix', '假的'); -team_property('shadowedPlayer', 'prefix', '挂机'); -global_version = '2.1.1'; -global_carpet_version = split('\\+v',system_info('scarpet_version')); -global_filename = system_info('app_name'); -__config() -> { - 'stay_loaded' -> true, - 'allow_command_conflicts' -> true, - 'commands' -> { - '' -> 'help', - 'spawn ' -> ['summon',null,null,null], - 'spawn at ' -> ['summon',null,null], - 'spawn at facing ' -> ['summon',null], - 'spawn at facing in ' -> 'summon', - 'kill ' -> 'kill', - 'killall' -> 'killall', - 'attack ' -> 'attack_once', - 'attack continuous' -> 'attack_continuous', - 'attack interval ' -> 'attack_interval', - 'attack once' -> 'attack_once', - 'drop all' -> 'drop_all', - 'drop ' -> 'drop_once', - 'drop continuous' -> 'drop_continuous', - 'drop interval ' -> 'drop_interval', - 'drop mainhand' -> 'drop_mainhand', - 'drop offhand' -> 'drop_offhand', - 'drop once' -> 'drop_once', - 'dropStack all' -> 'drop_stack_all', - 'dropStack ' -> 'drop_stack_once', - 'dropStack continuous' -> 'drop_stack_continuous', - 'dropStack interval ' -> 'drop_stack_interval', - 'dropStack mainhand' -> 'drop_stack_mainhand', - 'dropStack offhand' -> 'drop_stack_offhand', - 'dropStack once' -> 'drop_stack_once', - 'jump ' -> 'jump_once', - 'jump continuous' -> 'jump_continuous', - 'jump interval ' -> 'jump_interval', - 'jump once' -> 'jump_once', - 'swapHands ' -> 'swap_hands_once', - 'swapHands continuous' -> 'swap_hands_continuous', - 'swapHands interval ' -> 'swap_hands_interval', - 'swapHands once' -> 'swap_hands_once', - 'use ' -> 'use_once', - 'use continuous' -> 'use_continuous', - 'use interval ' -> 'use_interval', - 'use once' -> 'use_once', - 'mount ' -> 'mount', - 'dismount ' -> 'dismount', - 'sprint ' -> 'sprint', - 'unsprint ' -> 'unsprint', - 'sneak ' -> 'sneak', - 'unsneak ' -> 'unsneak', - 'look back' -> 'turn_back', - 'look left' -> 'turn_left', - 'look right' -> 'turn_right', - 'look up' -> 'look_up', - 'look down' -> 'look_down', - 'look east' -> 'look_east', - 'look north' -> 'look_north', - 'look south' -> 'look_south', - 'look west' -> 'look_west', - 'look ' -> 'look', - 'look position ' -> 'look_pos', - 'move backward' -> 'move_backward', - 'move forward' -> 'move_forward', - 'move left' -> 'move_left', - 'move right' -> 'move_right', - 'move stop' -> 'move_stop', - 'stop ' -> 'stop', - 'check ' -> 'check', - 'checkall' -> 'checkall', - 'tp ' -> 'tp', - 'tp ' -> 'tp_with_rotation', - 'tp ' -> 'tp_to_player', - 'tp atBot' -> 'tp_at_bot', - 'tp atBot' -> 'tp_at_bot_with_rotation', - 'hotbar ' -> 'hotbar', - 'shadow' -> 'shadow', - }, - 'arguments' -> { - 'dimension' -> { - 'type' -> 'text', - 'suggest' -> ['overworld','the_nether','the_end'] - }, - 'hotbar' -> { - 'type' -> 'int', - 'min' -> 1, - 'max' -> 9, - 'suggest' -> [1,2,3,4,5,6,7,8,9] - }, - 'bot' -> { - 'type' -> 'term', - 'suggester' -> _(args) -> ( - player_list = player('all'); - bot_list = l(); - c_for(i = 0, i < length(player_list), i += 1, - one_player_str = player_list:i; - if (scoreboard('carpetBot', one_player_str) == 1, - put(bot_list, length(bot_list), player_list:i) - ); - ); - put(bot_list, length(bot_list), player()); - return(bot_list) - ) - }, - 'killbot' -> { - 'type' -> 'term', - 'suggester' -> _(args) -> ( - player_list = player('all'); - bot_list = l(); - c_for(i = 0, i < length(player_list), i += 1, - one_player_str = player_list:i; - if (scoreboard('carpetBot', one_player_str) == 1, - put(bot_list, length(bot_list), player_list:i) - ); - ); - return(bot_list) - ) - }, - 'player' -> { - 'type' -> 'term', - 'suggester' -> _(args) -> player('all') - }, - 'tick' -> { - 'type' -> 'int', - 'min' -> 1, - 'suggest' -> [] - }, - 'rotation' -> { - 'type' -> 'rotation' - }, - 'position' -> { - 'type' -> 'location' - } - } -}; -__on_player_disconnects(player, reason) ->( - delete_all_files(player); - if(scoreboard('carpetBot', player) == 1, - scoreboard_remove('actimeCounter', player); - scoreboard_remove('carpetBot', player); - team_leave(player); - leaveGame = scoreboard('leaveGame', player); - scoreboard('leaveGame', player, leaveGame + 1); - ); -); -__on_server_shuts_down() ->( - player_list = player('all'); - c_for(i = 0, i < length(player_list), i += 1, - delete_all_files(player_list:i); - if(scoreboard('carpetBot', player) == 1, - scoreboard_remove('actimeCounter', player_list:i); - team_leave(player); - ) - ); - scoreboard_remove('carpetBot'); - team_remove('carpetBot'); - team_remove('shadowedPlayer') -); -check_fakeplayer(player_name) ->( - f_player = player(player_name); - if (!f_player, - ( - print('§4假人'+player_name+'未在线'); - exit() - ), - scoreboard('carpetBot', f_player) != 1 && f_player != player(), - ( - print('§4'+f_player+'不是假人'); - exit() - ) - ) -); -check_offline(player_name) ->( - f_player = player(player_name); - if (!f_player, - print('§4玩家或假人'+player_name+'未在线'); - exit() - ) -); -check_online(player_name) ->( - f_player = player(player_name); - if (f_player, - if (scoreboard('carpetBot', f_player) == 1, - print('§4假人'+f_player+'已经在线了'); - exit() - ); - print('§4玩家'+f_player+'已经在线了'); - exit() - ) -); -check_pos(x) ->( - x = number(x); - if(x == null, - print('§4请输入正确的坐标'); - exit() - ); - return(x) -); -check_dim(s_player,f_player) ->( - if (s_player~'dimension' != f_player~'dimension', - print('§4不在同一维度!'); - exit() - ); -); -delete_all_files(f_player) ->( - delete_file(f_player + '-' + 'attack', 'text'); - delete_file(f_player + '-' + 'drop', 'text'); - delete_file(f_player + '-' + 'drop_stack', 'text'); - delete_file(f_player + '-' + 'jump', 'text'); - delete_file(f_player + '-' + 'swap_hands', 'text'); - delete_file(f_player + '-' + 'use', 'text'); - delete_file(f_player + '-' + 'move_vertical', 'text'); - delete_file(f_player + '-' + 'move_transverse', 'text') -); -help() ->( - print('--使用帮助:'); - print('/' + global_filename + ' spawn <玩家名>\n - 生成假人'); - print('/' + global_filename + ' kill <玩家名>\n - 删除假人'); - print('/' + global_filename + ' killall\n - 删除全部假人'); - print('/' + global_filename + ' tp <玩家名> (<仰俯> <偏转>) (atBot)\n - 传送假人到,,,可选<仰俯>和<偏转>角度,如以结尾则相对坐标以假人为原点'); - print('/' + global_filename + ' look <玩家名> <仰俯> <偏转>\n - 转动假人视角,可替换为“s”来代表你的视角方向'); - print('/' + global_filename + ' look <玩家名> \n - 让假人向<上/下/东/西/南/北>方向看'); - print('/' + global_filename + ' look <玩家名> \n - 让假人向<后/左/右>方向看'); - print('/' + global_filename + ' move <玩家名> \n - 让假人<向前/向后/向左/向右>移动'); - print('/' + global_filename + ' <玩家名> continuous\n - 让假人持续<攻击或挖掘/丢一个物品/丢一组物品/跳跃/换手/使用物品>'); - print('/' + global_filename + ' <玩家名> interval <整数>\n - 让假人每<整数>游戏刻<攻击/丢一个物品/丢一组物品/跳跃/换手/使用物品>一次'); - print('/' + global_filename + ' <玩家名> once\n - 让假人<攻击或挖掘/丢一个物品/丢一组物品/跳跃/换手/使用物品>一次'); - print('/' + global_filename + ' <玩家名> <1-9>\n - 更改假人使用的热键栏'); - print('/' + global_filename + ' <玩家名> \n - 让假人<丢一个/丢一组><主手/副手>的物品'); - print('/' + global_filename + ' <玩家名>\n - 让假人<潜行/站立>'); - print('/' + global_filename + ' <玩家名>\n - 让假人准备<疾跑/行走>,在水中疾跑以游泳'); - print('/' + global_filename + ' <玩家名>\n - 让假人<乘坐/卸下>'); - print('/' + global_filename + ' stop <玩家名>\n - 停止假人的一切动作'); - print('/' + global_filename + ' check <玩家名>\n - 检查假人状态'); - print('/' + global_filename + ' checkall\n - 检查所有假人状态'); - print('tagplayer版本: ' + global_version); - print('carpet版本: ' + global_carpet_version:0); - if(number(global_carpet_version:1) < 201216 || global_carpet_version == null, - print('§4tagplayer需要地毯1.4.21或以上来运行!否则会出现预期之外的问题') - ); - return() -); -reload() ->( - run('script load ' + global_filename); - run('tellraw @a {"text":"+ global_filename +重载成功!"}'); - return() -); -summon(player_name, position, rotation, dimension) ->( - player_name = slice(player_name,0,15); - check_online(player_name); - s_player = player(); - if(position == null, - position = query(s_player, 'pos') - ); - if(rotation == null, - rotation = l(query(s_player, 'yaw'), query(s_player, 'pitch')) - ); - if(dimension == null, - dimension = query(s_player, 'dimension') - ); - run( - str('player %s spawn at %f %f %f facing %f %f in %s', - player_name, position:0, position:1, position:2, rotation:0, rotation:1, dimension - ) - ); - f_player = player(player_name); - if (!f_player, - print('§4生成失败'); - return() - ); - delete_all_files(f_player); - team_add('carpetBot', f_player); - run('tellraw @a {"text":"↑假的"}'); - scoreboard('carpetBot', f_player, 1); - return() -); -kill(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - if(f_player != player(), - ( - run('tellraw @a {"text":"↓假的"}'); - run(str('player %s kill', f_player)); - ), - print('§4你不是假人') - ); - return() -); -killall() ->( - player_list = team_list('carpetBot'); - c_for(i = 0, i < length(player_list), i += 1, - run(str('player %s kill', player_list:i)); - ); - if(player_list == l(), - print('§4不存在假人'); - return() - ); - game_tick(50); - run('tellraw @a {"text":"已清除全部假人"}'); - return() -); -//挂机 -shadow() ->( - f_player = player(); - run(str('player %s shadow', f_player)); - scoreboard('carpetBot', f_player, 1); - team_add('shadowedPlayer', f_player); - return() -); -//热键栏 -hotbar(player_name, hotbar) ->( - run(str('player %s hotbar %d', player_name, hotbar)); - return() -); -//攻击 -attack_continuous(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s attack continuous', player_name)); - delete_file(f_player + '-' + 'attack', 'text'); - write_file(f_player + '-' + 'attack', 'text', 0); - return() -); -attack_interval(player_name,tick) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s attack interval %d', player_name, tick)); - delete_file(f_player + '-' + 'attack', 'text'); - write_file(f_player + '-' + 'attack', 'text', tick); - return() -); -attack_once(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s attack once', player_name)); - delete_file(f_player + '-' + 'attack', 'text'); - return() -); -attack_stop(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s attack', player_name)); - delete_file(f_player + '-' + 'attack', 'text'); - return() -); -//丢弃 -drop_continuous(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s drop continuous', player_name)); - delete_file(f_player + '-' + 'drop', 'text'); - write_file(f_player + '-' + 'drop', 'text', 0); - return() -); -drop_interval(player_name,tick) ->( - f_player = player(player_name); - check_fakeplayer(player_name); run(str('player %s drop interval %d', player_name, tick)); - delete_file(f_player + '-' + 'drop', 'text'); - write_file(f_player + '-' + 'drop', 'text', tick); - return() -); -drop_once(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s drop once', player_name)); - delete_file(f_player + '-' + 'drop', 'text'); - return() -); -drop_stop(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s drop', player_name)); - delete_file(f_player + '-' + 'drop', 'text'); - return() -); -drop_all(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s drop all', player_name)); - return() -); -drop_offhand(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - return() -); -drop_mainhand(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s drop mainhand', player_name)); - return() -); -//丢弃一组 -drop_stack_continuous(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s dropStack continuous', player_name)); - delete_file(f_player + '-' + 'drop_stack', 'text'); - write_file(f_player + '-' + 'drop_stack', 'text', 0); - return() -); -drop_stack_interval(player_name,tick) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s dropStack interval %d', player_name, tick)); - delete_file(f_player + '-' + 'drop_stack', 'text'); - write_file(f_player + '-' + 'drop_stack', 'text', tick); - return() -); -drop_stack_once(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s dropStack once', player_name)); - delete_file(f_player + '-' + 'drop_stack', 'text'); - return() -); -drop_stack_stop(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s dropStack', player_name)); - delete_file(f_player + '-' + 'drop_stack', 'text'); - return() -); -drop_stack_all(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s dropStack all', player_name)); - return() -); -drop_stack_offhand(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s dropStack offhand', player_name)); - return() -); -drop_stack_mainhand(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s dropStack mainhand', player_name)); - return() -); -//跳跃 -jump_continuous(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s jump continuous', player_name)); - delete_file(f_player + '-' + 'jump', 'text'); - write_file(f_player + '-' + 'jump', 'text', 0); - return() -); -jump_interval(player_name,tick) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s jump interval %d', player_name, tick)); - delete_file(f_player + '-' + 'jump', 'text'); - write_file(f_player + '-' + 'jump', 'text', tick); - return() -); -jump_once(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s jump once', player_name)); - delete_file(f_player + '-' + 'jump', 'text'); - return() -); -jump_stop(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s jump', player_name)); - delete_file(f_player + '-' + 'jump', 'text'); - return() -); -//换手 -swap_hands_continuous(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s swapHands continuous', player_name)); - delete_file(f_player + '-' + 'swap_hands', 'text'); - write_file(f_player + '-' + 'swap_hands', 'text', 0); - return() -); -swap_hands_interval(player_name,tick) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s swapHands interval %d', player_name, tick)); - delete_file(f_player + '-' + 'swap_hands', 'text'); - write_file(f_player + '-' + 'swap_hands', 'text', tick); - return() -); -swap_hands_once(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s swapHands once', player_name)); - delete_file(f_player + '-' + 'swap_hands', 'text'); - return() -); -swap_hands_stop(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s swapHands', player_name)); - delete_file(f_player + '-' + 'swap_hands', 'text'); - return() -); -//右键 -use_continuous(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s use continuous', player_name)); - delete_file(f_player + '-' + 'use', 'text'); - write_file(f_player + '-' + 'use', 'text', 0); - return() -); -use_interval(player_name,tick) ->( - f_player = player(player_name); - check_fakeplayer(player_name); run(str('player %s use interval %d', player_name, tick)); - delete_file(f_player + '-' + 'use', 'text'); - write_file(f_player + '-' + 'use', 'text', tick); - return() -); -use_once(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s use once', player_name)); - delete_file(f_player + '-' + 'use', 'text'); - return() -); -use_stop(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s use', player_name)); - delete_file(f_player + '-' + 'use', 'text'); - return() -); -//骑乘 -mount(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s mount', player_name)); - return() -); -dismount(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s dismount', player_name)); - return() -); -//冲刺 -sprint(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s sprint', player_name)); - write_file(f_player + '-' + 'sprint', 'text', tick); - return() -); -unsprint(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s unsprint', player_name)); - delete_file(f_player + '-' + 'sprint', 'text'); - return() -); -//下蹲 -sneak(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s sneak', player_name)); - write_file(f_player + '-' + 'sneak', 'text', tick); - return() -); -unsneak(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s unsneak', player_name)); - delete_file(f_player + '-' + 'sneak', 'text'); - return() -); -//转向 -turn_back(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s turn back', player_name)); - return() -); -turn_left(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s turn left', player_name)); - return() -); -turn_right(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s turn right', player_name)); - return() -); -//看向 -look(player_name,rotation) ->( - print(rotation); - f_player = player(player_name); - check_fakeplayer(player_name); - s_player = player(); - x = (rotation:1)%360; - y = (rotation:0)%180; - if(x > 180, - x = x - 360 - ); - if(x < -180, - x = x + 360 - ); - if(y > 90, - y = y - 180 - ); - if(y < -90, - y = y + 180 - ); - modify(player(player_name), 'yaw', x); - modify(player(player_name), 'pitch', y); - print(str('已将'+player_name+'的视角指向§a[%.1f,%.1f]',x,y)); - return() -); -look_up(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s look up', player_name)); - return() -); -look_down(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s look down', player_name)); - return() -); -look_east(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s look east', player_name)); - return() -); -look_north(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s look north', player_name)); - return() -); -look_south(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s look south', player_name)); - return() -); -look_west(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s look west', player_name)); - return() -); -look_pos(player_name, position) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s look at %f %f %f', player_name, position:0, position:1, position:2)); - return() -); -//移动 -move_backward(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s move backward', player_name)); - delete_file(f_player + '-' + 'move_vertical', 'text'); - write_file(f_player + '-' + 'move_vertical', 'text', 'backward'); - return() -); -move_forward(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s move forward', player_name)); - delete_file(f_player + '-' + 'move_vertical', 'text'); - write_file(f_player + '-' + 'move_vertical', 'text', 'forward'); - return() -); -move_left(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s move left', player_name)); - delete_file(f_player + '-' + 'move_transverse', 'text'); - write_file(f_player + '-' + 'move_transverse', 'text', 'left'); - return() -); -move_right(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s move right', player_name)); - delete_file(f_player + '-' + 'move_transverse', 'text'); - write_file(f_player + '-' + 'move_transverse', 'text', 'right'); - return() -); -move_stop(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s move', player_name)); - delete_file(f_player + '-' + 'move_vertical', 'text'); - delete_file(f_player + '-' + 'move_transverse', 'text'); - return() -); -//停止 -stop(player_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - run(str('player %s stop', player_name)); - delete_all_files(f_player); - return() -); -//传送 -tp(player_name, position) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - s_player = player(); - x = position:0; - y = position:1; - if(y>4096 || y<-4096, - print('§4y值不能超过±4096!'); - return() - ); - z = position:2; - print(s_player~'yaw'+'|'+s_player~'pitch'); - run(str('tp %s %f %f %f %f %f', f_player, x, y, z, s_player~'yaw', s_player~'pitch')); - print(str('已将'+player_name+'传送至§a[%.2f,%.2f,%.2f]',x,y,z)); - return() -); -tp_with_rotation(player_name, position, rotation) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - s_player = player(); - f_player = player(player_name); - x = position:0; - y = position:1; - if(y>4096 || y<-4096, - print('§4y值不能超过±4096!'); - return() - ); - z = position:2; - yaw = (rotation:1)%360; - pitch = (rotation:0)%180; - if(yaw > 180, - yaw = yaw - 360 - ); - if(yaw < -180, - yaw = yaw + 360 - ); - if(pitch > 90, - pitch = pitch - 180 - ); - if(pitch < -90, - pitch = pitch + 180 - ); - run(str('tp %s %f %f %f %f %f', f_player, x, y, z, yaw, pitch)); - print(str('已将'+player_name+'传送至§a[%.2f,%.2f,%.2f]',x,y,z)); - return() -); -tp_to_player(player_name, target_name) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - s_player = player(target_name); - if (!s_player, - print('§4玩家未在线'); - return() - ); - run(str('tp %s %s', f_player, s_player)); - print(str('已将'+player_name+'传送至'+s_player)); - return() -); -tp_at_bot(player_name, position) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - s_player = player(); - x = position:0; - y = position:1; - if(y>4096 || y<-4096, - print('§4y值不能超过±4096!'); - return() - ); - z = position:2; - print(s_player~'yaw'+'|'+s_player~'pitch'); - run(str('execute at %s run tp %s %f %f %f', f_player, x, y, z)); - print(str('已将'+player_name+'传送至§a[%.2f,%.2f,%.2f]',x,y,z)); - return() -); -tp_at_bot_with_rotation(player_name, position, rotation) ->( - f_player = player(player_name); - check_fakeplayer(player_name); - s_player = player(); - f_player = player(player_name); - x = position:0; - y = position:1; - if(y>4096 || y<-4096, - print('§4y值不能超过±4096!'); - return() - ); - z = position:2; - yaw = (rotation:1)%360; - pitch = (rotation:0)%180; - if(yaw > 180, - yaw = yaw - 360 - ); - if(yaw < -180, - yaw = yaw + 360 - ); - if(pitch > 90, - pitch = pitch - 180 - ); - if(pitch < -90, - pitch = pitch + 180 - ); - run(str('execute at %s run tp %s %f %f %f %f %f', f_player, f_player, x, y, z, yaw, pitch)); - print(str('已将'+player_name+'传送至§a[%.2f,%.2f,%.2f]',x,y,z)); - return() -); -//状态检查 -check(player_name) ->( - check_offline(player_name); - f_player = player(player_name); - if(scoreboard('carpetBot', f_player) == 1, - ( - print('假人“'+f_player+'”:'); - ), - print('玩家“'+f_player+'”:'); - ); - //血量 - inner_health = number(str('%d',query(f_player,'health')+0.9)); - if(inner_health <= 5, - inner_color = '§4'; - ); - if(inner_health > 5 && inner_health <= 10, - inner_color = '§c'; - ); - if(inner_health > 10 && inner_health <= 15, - inner_color = '§e'; - ); - if(inner_health > 15, - inner_color = '§a'; - ); - print('- 血量:'+inner_color+inner_health); - //位置 - if(f_player~'dimension' == 'overworld', - f_dimension = '§2主世界' - ); - if(f_player~'dimension' == 'the_nether', - f_dimension = '§4地狱' - ); - if(f_player~'dimension' == 'the_end', - f_dimension = '§7末地' - ); - print(str('- 位于:%s§a[%.2f,%.2f,%.2f]',f_dimension,f_player~'x',f_player~'y',f_player~'z')); - //指向 - f_yaw = f_player~'yaw'; - if(f_yaw > 180, - f_yaw = f_yaw - 360 - ); - if(f_yaw < -180, - f_yaw = f_yaw + 360 - ); - if(f_yaw > -112.5 && f_yaw <= -67.5, - f_yaw_curt = '东' - ); - if(f_yaw > -22.5 && f_yaw <= 22.5, - f_yaw_curt = '南' - ); - if(f_yaw > 67.5 && f_yaw <= 112.5, - f_yaw_curt = '西' - ); - if(f_yaw > 157.5 || f_yaw <= -157.5, - f_yaw_curt = '北' - ); - if(f_yaw > -157.5 && f_yaw <= -112.5, - f_yaw_curt = '东北' - ); - if(f_yaw > -67.5 && f_yaw <= -22.5, - f_yaw_curt = '东南' - ); - if(f_yaw > 112.5 && f_yaw <= 157.5, - f_yaw_curt = '西北' - ); - if(f_yaw > 22.5 && f_yaw <= 67.5, - f_yaw_curt = '西南' - ); - f_pitch = f_player~'pitch'; - if(f_pitch > -15 && f_pitch <= 15, - f_pitch_curt = '前方' - ); - if(f_pitch > 15 && f_pitch <= 75, - f_pitch_curt = '斜下方' - ); - if(f_pitch > 75 && f_pitch <= 90, - f_pitch_curt = '下方' - ); - if(f_pitch > -75 && f_pitch <= -15, - f_pitch_curt = '斜上方' - ); - if(f_pitch >= -90 && f_pitch <= -75, - f_pitch_curt = '上方' - ); - print(str('- 指向:§e%s,%s§a[%.1f,%.1f]',f_yaw_curt,f_pitch_curt,f_yaw,f_pitch)); - f_state = global_bot_state:f_player; - //潜行/疾跑/游泳 - inner_sneak = query(f_player,'sneaking'); - inner_sprint = query(f_player,'sprinting'); - inner_swim = query(f_player,'swimming'); -//*************************************************** - noAct = true; - //攻击/挖掘 - inner_attack = read_file(f_player + '-' + 'attack', 'text'):0; - if(inner_attack != null, - if(inner_attack == 0, - print('- 正在挖掘'); - noAct = false - ); - if(inner_attack > 0, - inner_sec = inner_attack/20; - print('- 每' + inner_attack + '游戏刻(' + inner_sec + '游戏秒)尝试攻击一次'); - noAct = false - ) - ); - //扔东西 - inner_drop = read_file(f_player + '-' + 'drop', 'text'):0; - if(inner_drop != null, - if(inner_drop == 0, - print('- 正在持续每次扔一个物品'); - noAct = false - ); - if(inner_drop > 0, - inner_sec = inner_drop/20; - print('- 每' + inner_drop + '游戏刻(' + inner_sec + '游戏秒)扔1个物品'); - noAct = false - ) - ); - inner_drop_stack = read_file(f_player + '-' + 'drop_stack', 'text'):0; - if(inner_drop_stack != null, - if(inner_drop_stack == 0, - print('- 正在持续每次扔一组物品'); - noAct = false - ); - if(inner_drop > 0, - inner_sec = inner_drop_stack/20; - print('- 每' + inner_drop_stack + '游戏刻(' + inner_sec + '游戏秒)扔1个物品'); - noAct = false - ) - ); - //跳跃 - inner_jump = read_file(f_player + '-' + 'jump', 'text'):0; - if(inner_jump != null, - if(inner_jump == 0, - print('- 正在持续跳跃'); - noAct = false - ); - if(inner_jump > 0, - inner_sec = inner_jump/20; - print('- 每' + inner_jump + '游戏刻(' + inner_sec + '游戏秒)尝试跳跃一次'); - noAct = false - ) - ); - //换手 - inner_swap_hands = read_file(f_player + '-' + 'swap_hands', 'text'):0; - if(inner_swap_hands != null, - if(inner_swap_hands == 0, - print('- 正在持续交换左右手的物品'); - noAct = false - ); - if(inner_swap_hands > 0, - inner_sec = inner_swap_hands/20; - print('- 每' + inner_swap_hands + '游戏刻(' + inner_sec + '游戏秒)交换一次左右手的物品'); - noAct = false - ) - ); - //使用物品 - inner_use = read_file(f_player + '-' + 'use', 'text'):0; - if(inner_use != null, - if(inner_use == 0, - print('- 正在持续使♂用物品'); - noAct = false - ); - if(inner_use > 0, - inner_sec = inner_use/20; - print('- 每' + inner_use + '游戏刻(' + inner_sec + '游戏秒)尝试使用一次物♂品'); - noAct = false - ) - ); - //移动**********************************重点********************************* - inner_move_vertical = read_file(f_player + '-' + 'move_vertical', 'text'):0; - inner_move_transverse = read_file(f_player + '-' + 'move_transverse', 'text'):0; - if(inner_sneak == true, - if(inner_move_vertical == 'forward', - if(inner_move_transverse == 'right', - print('- 正在向右前方潜行↗'); - noAct = false - ); - if(inner_move_transverse == 'left', - print('- 正在向左前方潜行↖'); - noAct = false - ); - if(inner_move_transverse == null, - print('- 正在向前潜行↑'); - noAct = false - ) - ); - if(inner_move_vertical == 'backward', - if(inner_move_transverse == 'right', - print('- 正在向右后方潜行↘'); - noAct = false - ); - if(inner_move_transverse == 'left', - print('- 正在向左后方潜行↙'); - noAct = false - ); - if(inner_move_transverse == null, - print('- 正在向后潜行↓'); - noAct = false - ) - ); - if(inner_move_vertical == null, - if(inner_move_transverse == 'right', - print('- 正在向右潜行→'); - noAct = false - ); - if(inner_move_transverse == 'left', - print('- 正在向左潜行←'); - noAct = false - ); - if(inner_move_transverse == null, - print('- 正在潜伏'); - noAct = false - ) - ) - ); - if(inner_sprint == true, - if(inner_swim == true, - if(inner_move_vertical == 'forward', - if(inner_move_transverse == 'right', - print('- 正在向右前方游泳↗'); - noAct = false - ); - if(inner_move_transverse == 'left', - print('- 正在向左前方游泳↖'); - noAct = false - ); - if(inner_move_transverse == null, - print('- 正在向前游泳↑'); - noAct = false - ) - ); - if(inner_move_vertical == 'backward', - if(inner_move_transverse == 'right', - print('- 正在向右后方游泳↘§e(没错它可以开挂)'); - noAct = false - ); - if(inner_move_transverse == 'left', - print('- 正在向左后方游泳↙§e(没错它可以开挂)'); - noAct = false - ); - if(inner_move_transverse == null, - print('- 正在向后游泳↓§e(没错它可以开挂)'); - noAct = false - ) - ); - if(inner_move_vertical == null, - if(inner_move_transverse == 'right', - print('- 正在向右游泳→§e(没错它可以开挂)'); - noAct = false - ); - if(inner_move_transverse == 'left', - print('- 正在向左游泳←§e(没错它可以开挂)'); - noAct = false - ); - if(inner_move_transverse == null, - print('- 正在原地游泳↓§e(没错它可以开挂)'); - noAct = false - ) - ) - ); - if(inner_swim == false, - if(inner_move_vertical == 'forward', - if(inner_move_transverse == 'right', - print('- 正在向右前方疾跑↗'); - noAct = false - ); - if(inner_move_transverse == 'left', - print('- 正在向左前方疾跑↖'); - noAct = false - ); - if(inner_move_transverse == null, - print('- 正在向前疾跑↑'); - noAct = false - ) - ); - if(inner_move_vertical == 'backward', - if(inner_move_transverse == 'right', - print('- 正在向右后方疾跑↘§e(没错它可以开挂)'); - noAct = false - ); - if(inner_move_transverse == 'left', - print('- 正在向左后方疾跑↙§e(没错它可以开挂)'); - noAct = false - ); - if(inner_move_transverse == null, - print('- 正在向后疾跑↓§e(没错它可以开挂)'); - noAct = false - ) - ); - if(inner_move_vertical == null, - if(inner_move_transverse == 'right', - print('- 正在向右疾跑→§e(没错它可以开挂)'); - noAct = false - ); - if(inner_move_transverse == 'left', - print('- 正在向左疾跑←§e(没错它可以开挂)'); - noAct = false - ); - if(inner_move_transverse == null, - print('- 正在原地疾跑,§e(没错它可以开挂)'); - noAct = false - ) - ) - ); - ); - if(inner_sprint == false && inner_sneak == false, - if(inner_move_vertical == 'forward', - if(inner_move_transverse == 'right', - print('- 正在向右前方走↗'); - noAct = false - ); - if(inner_move_transverse == 'left', - print('- 正在向左前方走↖'); - noAct = false - ); - if(inner_move_transverse == null, - print('- 正在向前走↑'); - noAct = false - ) - ); - if(inner_move_vertical == 'backward', - if(inner_move_transverse == 'right', - print('- 正在向右后方走↘'); - noAct = false - ); - if(inner_move_transverse == 'left', - print('- 正在向左后方走↙'); - noAct = false - ); - if(inner_move_transverse == null, - print('- 正在向后走↓'); - noAct = false - ) - ); - if(inner_move_vertical == null, - if(inner_move_transverse == 'right', - print('- 正在向右走→'); - noAct = false - ); - if(inner_move_transverse == 'left', - print('- 正在向左走←'); - noAct = false - ) - ) - ); - //乘坐 - inner_mount = f_player~'mount'; - if(inner_mount != null, - if(inner_mount == 'horse', - print('- 正在骑马') - ); - if(inner_mount == 'donkey', - print('- 正在骑驴') - ); - if(inner_mount == 'mule', - print('- 正在骑骡') - ); - if(inner_mount == 'trader_llama', - print('- 正在骑羊驼') - ); - if(inner_mount == 'pig', - print('- 正在骑猪') - ); - if(inner_mount == 'skeleton_horse', - print('- 正在骑骷髅马') - ); - if(inner_mount == 'zombie_horse', - print('- 正在骑僵尸马') - ); - noAct = false - ); - if(noAct == true, - print('- 无地毯动作') - ); - return() -); -checkall() ->( - player_list = player('all'); - c_for(i = 0, i < length(player_list), i += 1, - check(player_list:i); - ); - return() -); -run(str('tellraw @a {"text": "[版本信息]tagplayer版本: ' + global_version + '", "color": "#ffd900"}')); -run(str('tellraw @a {"text": "[版本信息]carpet版本: ' + global_carpet_version:0 + '", "color": "#ffd900"}')); -if(number(global_carpet_version:1) < 201216 || global_carpet_version == null, - run(str('tellraw @a {"text": "[错误]tagplayer需要地毯1.4.21或以上来运行!否则会出现预期之外的问题", "color": "#ff6100"}');) +//************************************************************* +//************请将该文件放入"world\scripts"文件夹中************ +//*************可以自定义插件名,但不能为“player”************** +//************************************************************* +scoreboard_add('carpetBot'); +team_add('carpetBot'); +team_add('shadowedPlayer'); +team_property('carpetBot', 'prefix', '假的'); +team_property('shadowedPlayer', 'prefix', '挂机'); +global_version = '2.4.0'; +global_carpet_version = split('\\+v',system_info('scarpet_version')); +global_require_carpet_version = ['1.4.22', 210113]; +global_filename = system_info('app_name'); +run('data merge storage minecraft:fz.tagplayer {filename:"' + global_filename + '"}'); +run('carpet setDefault commandPlayer ops'); + +config = read_file('config/config', 'json'); +global_config = m(); +if (config == null, + ( + global_config = {'allow_spawning_whitelist_players' -> 'true'}; + ), + if (config:'allow_spawning_whitelist_players' == null || + (config:'allow_spawning_whitelist_players' != 'true' && config:'allow_spawning_whitelist_players' != 'false'), + ( + global_config:'allow_spawning_whitelist_players' = 'true' + ), + global_config:'allow_spawning_whitelist_players' = config:'allow_spawning_whitelist_players'; + ); +); +logger(config:'allow_spawning_whitelist_players'); +delete_file('config/config', 'json'); +write_file('config/config', 'json', global_config); + +__config() -> { + 'scope' -> 'global', + 'stay_loaded' -> true, + 'allow_command_conflicts' -> true, + 'commands' -> { + '' -> 'help', + 'spawn ' -> ['summon',null,null,null], + 'spawn at ' -> ['summon',null,null], + 'spawn at facing ' -> ['summon',null], + 'spawn at facing in ' -> 'summon', + 'kill ' -> 'kill', + 'killall' -> 'killall', + 'attack ' -> 'attack_once', + 'attack continuous' -> 'attack_continuous', + 'attack interval ' -> 'attack_interval', + 'attack once' -> 'attack_once', + 'drop all' -> 'drop_all', + 'drop ' -> 'drop_once', + 'drop continuous' -> 'drop_continuous', + 'drop interval ' -> 'drop_interval', + 'drop mainhand' -> 'drop_mainhand', + 'drop offhand' -> 'drop_offhand', + 'drop once' -> 'drop_once', + 'dropStack all' -> 'drop_stack_all', + 'dropStack ' -> 'drop_stack_once', + 'dropStack continuous' -> 'drop_stack_continuous', + 'dropStack interval ' -> 'drop_stack_interval', + 'dropStack mainhand' -> 'drop_stack_mainhand', + 'dropStack offhand' -> 'drop_stack_offhand', + 'dropStack once' -> 'drop_stack_once', + 'jump ' -> 'jump_once', + 'jump continuous' -> 'jump_continuous', + 'jump interval ' -> 'jump_interval', + 'jump once' -> 'jump_once', + 'swapHands ' -> 'swap_hands_once', + 'swapHands continuous' -> 'swap_hands_continuous', + 'swapHands interval ' -> 'swap_hands_interval', + 'swapHands once' -> 'swap_hands_once', + 'use ' -> 'use_once', + 'use continuous' -> 'use_continuous', + 'use interval ' -> 'use_interval', + 'use once' -> 'use_once', + 'mount ' -> 'mount', + 'dismount ' -> 'dismount', + 'sprint ' -> 'sprint', + 'unsprint ' -> 'unsprint', + 'sneak ' -> 'sneak', + 'unsneak ' -> 'unsneak', + 'look back' -> 'turn_back', + 'look left' -> 'turn_left', + 'look right' -> 'turn_right', + 'look up' -> 'look_up', + 'look down' -> 'look_down', + 'look east' -> 'look_east', + 'look north' -> 'look_north', + 'look south' -> 'look_south', + 'look west' -> 'look_west', + 'look ' -> 'look', + 'look position ' -> 'look_pos', + 'move backward' -> 'move_backward', + 'move forward' -> 'move_forward', + 'move left' -> 'move_left', + 'move right' -> 'move_right', + 'move stop' -> 'move_stop', + 'stop ' -> 'stop', + 'check ' -> 'check', + 'checkall' -> 'checkall', + 'tp ' -> 'tp', + 'tp ' -> 'tp_with_rotation', + 'tp ' -> 'tp_to_player', + 'tp atBot' -> 'tp_at_bot', + 'tp atBot' -> 'tp_at_bot_with_rotation', + 'hotbar ' -> 'hotbar', + 'shadow' -> 'shadow', + }, + 'arguments' -> { + 'dimension' -> { + 'type' -> 'text', + 'suggest' -> ['overworld','the_nether','the_end'] + }, + 'hotbar' -> { + 'type' -> 'int', + 'min' -> 1, + 'max' -> 9, + 'suggest' -> [1,2,3,4,5,6,7,8,9] + }, + 'bot' -> { + 'type' -> 'term', + 'suggester' -> _(args) -> ( + player_list = player('all'); + bot_list = l(); + c_for(i = 0, i < length(player_list), i += 1, + one_player_str = player_list:i; + if (scoreboard('carpetBot', one_player_str) == 1, + put(bot_list, length(bot_list), player_list:i) + ); + ); + put(bot_list, length(bot_list), player()); + return(bot_list) + ) + }, + 'killbot' -> { + 'type' -> 'term', + 'suggester' -> _(args) -> ( + player_list = player('all'); + bot_list = l(); + c_for(i = 0, i < length(player_list), i += 1, + one_player_str = player_list:i; + if (scoreboard('carpetBot', one_player_str) == 1, + put(bot_list, length(bot_list), player_list:i) + ); + ); + return(bot_list) + ) + }, + 'player' -> { + 'type' -> 'term', + 'suggester' -> _(args) -> player('all') + }, + 'tick' -> { + 'type' -> 'int', + 'min' -> 1, + 'suggest' -> [] + }, + 'rotation' -> { + 'type' -> 'rotation' + }, + 'position' -> { + 'type' -> 'location' + } + } +}; +__on_player_disconnects(player, reason) ->( + delete_all_files(player); + if(scoreboard('carpetBot', player) == 1, + scoreboard_remove('actimeCounter', player); + scoreboard_remove('carpetBot', player); + team_leave(player); + leaveGame = scoreboard('leaveGame', player); + scoreboard('leaveGame', player, leaveGame + 1); + ); +); +__on_player_connects(player) -> ( + run('tellraw ' + player + ' {"text":"[提醒]输入“/' + global_filename + '”查看假人相关功能的帮助", "color":"#66ffff"}'); +); +__on_server_shuts_down() ->( + player_list = player('all'); + c_for(i = 0, i < length(player_list), i += 1, + delete_all_files(player_list:i); + if(scoreboard('carpetBot', player) == 1, + scoreboard_remove('actimeCounter', player_list:i); + team_leave(player); + ) + ); + scoreboard_remove('carpetBot'); + team_remove('carpetBot'); + team_remove('shadowedPlayer') +); +check_fakeplayer(player_name) ->( + f_player = player(player_name); + if (!f_player, + ( + print('§4假人'+player_name+'未在线'); + exit() + ), + scoreboard('carpetBot', f_player) != 1 && f_player != player(), + ( + print('§4'+f_player+'不是假人'); + exit() + ) + ) +); +check_offline(player_name) ->( + f_player = player(player_name); + if (!f_player, + print('§4玩家或假人'+player_name+'未在线'); + exit() + ) +); +check_online(player_name) ->( + if (global_config:'allow_spawning_whitelist_players' == 'false', + wl = keys(system_info('server_whitelist')); + c_for(i = 0, i < length(wl), i += 1, + if (lower(wl:i) == lower(player_name), + print('§4'+player_name+'是白名单玩家'); + exit() + ); + ); + ); + f_player = player(player_name); + if (f_player, + if (scoreboard('carpetBot', f_player) == 1, + print('§4假人'+f_player+'已经在线了'); + exit() + ); + print('§4玩家'+f_player+'已经在线了'); + exit() + ) +); +check_pos(x) ->( + x = number(x); + if(x == null, + print('§4请输入正确的坐标'); + exit() + ); + return(x) +); +check_dim(s_player,f_player) ->( + if (s_player~'dimension' != f_player~'dimension', + print('§4不在同一维度!'); + exit() + ); +); +delete_all_files(f_player) ->( + delete_file(f_player + '-' + 'attack', 'text'); + delete_file(f_player + '-' + 'drop', 'text'); + delete_file(f_player + '-' + 'drop_stack', 'text'); + delete_file(f_player + '-' + 'jump', 'text'); + delete_file(f_player + '-' + 'swap_hands', 'text'); + delete_file(f_player + '-' + 'use', 'text'); + delete_file(f_player + '-' + 'move_vertical', 'text'); + delete_file(f_player + '-' + 'move_transverse', 'text') +); +help() ->( + print('--使用帮助:'); + print('/' + global_filename + ' spawn <玩家名> (at facing <仰俯> <偏转> in )\n - 生成假人可选“at”、“facing”、“in”参数'); + print('/' + global_filename + ' kill <玩家名>\n - 删除假人'); + print('/' + global_filename + ' killall\n - 删除全部假人'); + print('/' + global_filename + ' tp <玩家名> (<仰俯> <偏转>) (atBot)\n - 传送假人到,,,可选<仰俯>和<偏转>角度,如以结尾则相对坐标以假人为原点'); + print('/' + global_filename + ' look <玩家名> <仰俯> <偏转>\n - 转动假人视角,可替换为“s”来代表你的视角方向'); + print('/' + global_filename + ' look <玩家名> \n - 让假人向<上/下/东/西/南/北>方向看'); + print('/' + global_filename + ' look <玩家名> \n - 让假人向<后/左/右>方向看'); + print('/' + global_filename + ' move <玩家名> \n - 让假人<向前/向后/向左/向右>移动'); + print('/' + global_filename + ' <玩家名> continuous\n - 让假人持续<攻击或挖掘/丢一个物品/丢一组物品/跳跃/换手/使用物品>'); + print('/' + global_filename + ' <玩家名> interval <整数>\n - 让假人每<整数>游戏刻<攻击/丢一个物品/丢一组物品/跳跃/换手/使用物品>一次'); + print('/' + global_filename + ' <玩家名> once\n - 让假人<攻击或挖掘/丢一个物品/丢一组物品/跳跃/换手/使用物品>一次'); + print('/' + global_filename + ' <玩家名> <1-9>\n - 更改假人使用的热键栏'); + print('/' + global_filename + ' <玩家名> \n - 让假人<丢一个/丢一组><主手/副手>的物品'); + print('/' + global_filename + ' <玩家名>\n - 让假人<潜行/站立>'); + print('/' + global_filename + ' <玩家名>\n - 让假人准备<疾跑/行走>,在水中疾跑以游泳'); + print('/' + global_filename + ' <玩家名>\n - 让假人<乘坐/卸下>'); + print('/' + global_filename + ' stop <玩家名>\n - 停止假人的一切动作'); + print('/' + global_filename + ' check <玩家名>\n - 检查假人状态'); + print('/' + global_filename + ' checkall\n - 检查所有假人状态'); + print('' + global_filename + '版本: ' + global_version); + print('carpet版本: ' + global_carpet_version:0); + if(number(global_carpet_version:1) < global_require_carpet_version:1 || global_carpet_version == null, + print('§4' + global_filename + '需要地毯' + global_require_carpet_version:0 + '或以上来运行!否则会出现预期之外的问题') + ); + return() +); +reload() ->( + run('script load ' + global_filename); + run('tellraw @a {"text":"+ global_filename +重载成功!"}'); + return() +); +summon(player_name, position, rotation, dimension) ->( + if(length(player_name) > 16, + player_name = slice(player_name,0,15) + ); + check_online(player_name); + s_player = player(); + if(position == null, + position = query(s_player, 'pos') + ); + if(rotation == null, + rotation = l(query(s_player, 'yaw'), query(s_player, 'pitch')) + ); + if(dimension == null, + dimension = query(s_player, 'dimension') + ); + run( + str('player %s spawn at %f %f %f facing %f %f in %s', + player_name, position:0, position:1, position:2, rotation:0, rotation:1, dimension + ) + ); + f_player = player(player_name); + if (!f_player, + print('§4生成失败'); + return() + ); + delete_all_files(f_player); + team_add('carpetBot', f_player); + run('tellraw @a {"text":"↑假的"}'); + scoreboard('carpetBot', f_player, 1); + return() +); +kill(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + if(f_player != player(), + ( + run('tellraw @a {"text":"↓假的"}'); + run(str('player %s kill', f_player)); + ), + print('§4你不是假人') + ); + return() +); +killall() ->( + player_list = team_list('carpetBot'); + c_for(i = 0, i < length(player_list), i += 1, + run(str('player %s kill', player_list:i)); + ); + if(player_list == l(), + print('§4不存在假人'); + return() + ); + game_tick(50); + run('tellraw @a {"text":"已清除全部假人"}'); + return() +); +//挂机 +shadow() ->( + f_player = player(); + run(str('player %s shadow', f_player)); + scoreboard('carpetBot', f_player, 1); + team_add('shadowedPlayer', f_player); + return() +); +//热键栏 +hotbar(player_name, hotbar) ->( + run(str('player %s hotbar %d', player_name, hotbar)); + return() +); +//攻击 +attack_continuous(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s attack continuous', player_name)); + delete_file(f_player + '-' + 'attack', 'text'); + write_file(f_player + '-' + 'attack', 'text', 0); + return() +); +attack_interval(player_name,tick) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s attack interval %d', player_name, tick)); + delete_file(f_player + '-' + 'attack', 'text'); + write_file(f_player + '-' + 'attack', 'text', tick); + return() +); +attack_once(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s attack once', player_name)); + delete_file(f_player + '-' + 'attack', 'text'); + return() +); +attack_stop(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s attack', player_name)); + delete_file(f_player + '-' + 'attack', 'text'); + return() +); +//丢弃 +drop_continuous(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s drop continuous', player_name)); + delete_file(f_player + '-' + 'drop', 'text'); + write_file(f_player + '-' + 'drop', 'text', 0); + return() +); +drop_interval(player_name,tick) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s drop interval %d', player_name, tick)); + delete_file(f_player + '-' + 'drop', 'text'); + write_file(f_player + '-' + 'drop', 'text', tick); + return() +); +drop_once(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s drop once', player_name)); + delete_file(f_player + '-' + 'drop', 'text'); + return() +); +drop_stop(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s drop', player_name)); + delete_file(f_player + '-' + 'drop', 'text'); + return() +); +drop_all(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s drop all', player_name)); + return() +); +drop_offhand(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + return() +); +drop_mainhand(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s drop mainhand', player_name)); + return() +); +//丢弃一组 +drop_stack_continuous(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s dropStack continuous', player_name)); + delete_file(f_player + '-' + 'drop_stack', 'text'); + write_file(f_player + '-' + 'drop_stack', 'text', 0); + return() +); +drop_stack_interval(player_name,tick) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s dropStack interval %d', player_name, tick)); + delete_file(f_player + '-' + 'drop_stack', 'text'); + write_file(f_player + '-' + 'drop_stack', 'text', tick); + return() +); +drop_stack_once(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s dropStack once', player_name)); + delete_file(f_player + '-' + 'drop_stack', 'text'); + return() +); +drop_stack_stop(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s dropStack', player_name)); + delete_file(f_player + '-' + 'drop_stack', 'text'); + return() +); +drop_stack_all(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s dropStack all', player_name)); + return() +); +drop_stack_offhand(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s dropStack offhand', player_name)); + return() +); +drop_stack_mainhand(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s dropStack mainhand', player_name)); + return() +); +//跳跃 +jump_continuous(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s jump continuous', player_name)); + delete_file(f_player + '-' + 'jump', 'text'); + write_file(f_player + '-' + 'jump', 'text', 0); + return() +); +jump_interval(player_name,tick) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s jump interval %d', player_name, tick)); + delete_file(f_player + '-' + 'jump', 'text'); + write_file(f_player + '-' + 'jump', 'text', tick); + return() +); +jump_once(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s jump once', player_name)); + delete_file(f_player + '-' + 'jump', 'text'); + return() +); +jump_stop(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s jump', player_name)); + delete_file(f_player + '-' + 'jump', 'text'); + return() +); +//换手 +swap_hands_continuous(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s swapHands continuous', player_name)); + delete_file(f_player + '-' + 'swap_hands', 'text'); + write_file(f_player + '-' + 'swap_hands', 'text', 0); + return() +); +swap_hands_interval(player_name,tick) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s swapHands interval %d', player_name, tick)); + delete_file(f_player + '-' + 'swap_hands', 'text'); + write_file(f_player + '-' + 'swap_hands', 'text', tick); + return() +); +swap_hands_once(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s swapHands once', player_name)); + delete_file(f_player + '-' + 'swap_hands', 'text'); + return() +); +swap_hands_stop(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s swapHands', player_name)); + delete_file(f_player + '-' + 'swap_hands', 'text'); + return() +); +//右键 +use_continuous(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s use continuous', player_name)); + delete_file(f_player + '-' + 'use', 'text'); + write_file(f_player + '-' + 'use', 'text', 0); + return() +); +use_interval(player_name,tick) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s use interval %d', player_name, tick)); + delete_file(f_player + '-' + 'use', 'text'); + write_file(f_player + '-' + 'use', 'text', tick); + return() +); +use_once(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s use once', player_name)); + delete_file(f_player + '-' + 'use', 'text'); + return() +); +use_stop(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s use', player_name)); + delete_file(f_player + '-' + 'use', 'text'); + return() +); +//骑乘 +mount(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s mount', player_name)); + return() +); +dismount(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s dismount', player_name)); + return() +); +//冲刺 +sprint(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s sprint', player_name)); + write_file(f_player + '-' + 'sprint', 'text', tick); + return() +); +unsprint(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s unsprint', player_name)); + delete_file(f_player + '-' + 'sprint', 'text'); + return() +); +//下蹲 +sneak(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s sneak', player_name)); + write_file(f_player + '-' + 'sneak', 'text', tick); + return() +); +unsneak(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s unsneak', player_name)); + delete_file(f_player + '-' + 'sneak', 'text'); + return() +); +//转向 +turn_back(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s turn back', player_name)); + return() +); +turn_left(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s turn left', player_name)); + return() +); +turn_right(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s turn right', player_name)); + return() +); +//看向 +look(player_name,rotation) ->( + print(rotation); + f_player = player(player_name); + check_fakeplayer(player_name); + s_player = player(); + x = (rotation:1)%360; + y = (rotation:0)%180; + if(x > 180, + x = x - 360 + ); + if(x < -180, + x = x + 360 + ); + if(y > 90, + y = y - 180 + ); + if(y < -90, + y = y + 180 + ); + modify(player(player_name), 'yaw', x); + modify(player(player_name), 'pitch', y); + print(str('已将'+player_name+'的视角指向§a[%.1f,%.1f]',x,y)); + return() +); +look_up(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s look up', player_name)); + return() +); +look_down(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s look down', player_name)); + return() +); +look_east(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s look east', player_name)); + return() +); +look_north(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s look north', player_name)); + return() +); +look_south(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s look south', player_name)); + return() +); +look_west(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s look west', player_name)); + return() +); +look_pos(player_name, position) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s look at %f %f %f', player_name, position:0, position:1, position:2)); + return() +); +//移动 +move_backward(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s move backward', player_name)); + delete_file(f_player + '-' + 'move_vertical', 'text'); + write_file(f_player + '-' + 'move_vertical', 'text', 'backward'); + return() +); +move_forward(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s move forward', player_name)); + delete_file(f_player + '-' + 'move_vertical', 'text'); + write_file(f_player + '-' + 'move_vertical', 'text', 'forward'); + return() +); +move_left(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s move left', player_name)); + delete_file(f_player + '-' + 'move_transverse', 'text'); + write_file(f_player + '-' + 'move_transverse', 'text', 'left'); + return() +); +move_right(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s move right', player_name)); + delete_file(f_player + '-' + 'move_transverse', 'text'); + write_file(f_player + '-' + 'move_transverse', 'text', 'right'); + return() +); +move_stop(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s move', player_name)); + delete_file(f_player + '-' + 'move_vertical', 'text'); + delete_file(f_player + '-' + 'move_transverse', 'text'); + return() +); +//停止 +stop(player_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + run(str('player %s stop', player_name)); + delete_all_files(f_player); + return() +); +//传送 +tp(player_name, position) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + s_player = player(); + x = position:0; + y = position:1; + if(y>4096 || y<-4096, + print('§4y值不能超过±4096!'); + return() + ); + z = position:2; + print(s_player~'yaw'+'|'+s_player~'pitch'); + run(str('tp %s %f %f %f %f %f', f_player, x, y, z, s_player~'yaw', s_player~'pitch')); + print(str('已将'+player_name+'传送至§a[%.2f,%.2f,%.2f]',x,y,z)); + return() +); +tp_with_rotation(player_name, position, rotation) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + s_player = player(); + f_player = player(player_name); + x = position:0; + y = position:1; + if(y>4096 || y<-4096, + print('§4y值不能超过±4096!'); + return() + ); + z = position:2; + yaw = (rotation:1)%360; + pitch = (rotation:0)%180; + if(yaw > 180, + yaw = yaw - 360 + ); + if(yaw < -180, + yaw = yaw + 360 + ); + if(pitch > 90, + pitch = pitch - 180 + ); + if(pitch < -90, + pitch = pitch + 180 + ); + run(str('tp %s %f %f %f %f %f', f_player, x, y, z, yaw, pitch)); + print(str('已将'+player_name+'传送至§a[%.2f,%.2f,%.2f]',x,y,z)); + return() +); +tp_to_player(player_name, target_name) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + s_player = player(target_name); + if (!s_player, + print('§4玩家未在线'); + return() + ); + run(str('tp %s %s', f_player, s_player)); + print(str('已将'+player_name+'传送至'+s_player)); + return() +); +tp_at_bot(player_name, position) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + s_player = player(); + x = position:0; + y = position:1; + if(y>4096 || y<-4096, + print('§4y值不能超过±4096!'); + return() + ); + z = position:2; + print(s_player~'yaw'+'|'+s_player~'pitch'); + run(str('execute at %s run tp %s %f %f %f', f_player, x, y, z)); + print(str('已将'+player_name+'传送至§a[%.2f,%.2f,%.2f]',x,y,z)); + return() +); +tp_at_bot_with_rotation(player_name, position, rotation) ->( + f_player = player(player_name); + check_fakeplayer(player_name); + s_player = player(); + f_player = player(player_name); + x = position:0; + y = position:1; + if(y>4096 || y<-4096, + print('§4y值不能超过±4096!'); + return() + ); + z = position:2; + yaw = (rotation:1)%360; + pitch = (rotation:0)%180; + if(yaw > 180, + yaw = yaw - 360 + ); + if(yaw < -180, + yaw = yaw + 360 + ); + if(pitch > 90, + pitch = pitch - 180 + ); + if(pitch < -90, + pitch = pitch + 180 + ); + run(str('execute at %s run tp %s %f %f %f %f %f', f_player, f_player, x, y, z, yaw, pitch)); + print(str('已将'+player_name+'传送至§a[%.2f,%.2f,%.2f]',x,y,z)); + return() +); +//状态检查 +check(player_name) ->( + check_offline(player_name); + f_player = player(player_name); + if(scoreboard('carpetBot', f_player) == 1, + ( + print('假人“'+f_player+'”:'); + ), + print('玩家“'+f_player+'”:'); + ); + //血量 + inner_health = number(str('%d',query(f_player,'health')+0.9)); + if(inner_health <= 5, + inner_color = '§4'; + ); + if(inner_health > 5 && inner_health <= 10, + inner_color = '§c'; + ); + if(inner_health > 10 && inner_health <= 15, + inner_color = '§e'; + ); + if(inner_health > 15, + inner_color = '§a'; + ); + print('- 血量:'+inner_color+inner_health); + //位置 + if(f_player~'dimension' == 'overworld', + f_dimension = '§2主世界' + ); + if(f_player~'dimension' == 'the_nether', + f_dimension = '§4地狱' + ); + if(f_player~'dimension' == 'the_end', + f_dimension = '§7末地' + ); + print(str('- 位于:%s§a[%.2f,%.2f,%.2f]',f_dimension,f_player~'x',f_player~'y',f_player~'z')); + //指向 + f_yaw = f_player~'yaw'; + if(f_yaw > 180, + f_yaw = f_yaw - 360 + ); + if(f_yaw < -180, + f_yaw = f_yaw + 360 + ); + if(f_yaw > -112.5 && f_yaw <= -67.5, + f_yaw_curt = '东' + ); + if(f_yaw > -22.5 && f_yaw <= 22.5, + f_yaw_curt = '南' + ); + if(f_yaw > 67.5 && f_yaw <= 112.5, + f_yaw_curt = '西' + ); + if(f_yaw > 157.5 || f_yaw <= -157.5, + f_yaw_curt = '北' + ); + if(f_yaw > -157.5 && f_yaw <= -112.5, + f_yaw_curt = '东北' + ); + if(f_yaw > -67.5 && f_yaw <= -22.5, + f_yaw_curt = '东南' + ); + if(f_yaw > 112.5 && f_yaw <= 157.5, + f_yaw_curt = '西北' + ); + if(f_yaw > 22.5 && f_yaw <= 67.5, + f_yaw_curt = '西南' + ); + f_pitch = f_player~'pitch'; + if(f_pitch > -15 && f_pitch <= 15, + f_pitch_curt = '前方' + ); + if(f_pitch > 15 && f_pitch <= 75, + f_pitch_curt = '斜下方' + ); + if(f_pitch > 75 && f_pitch <= 90, + f_pitch_curt = '下方' + ); + if(f_pitch > -75 && f_pitch <= -15, + f_pitch_curt = '斜上方' + ); + if(f_pitch >= -90 && f_pitch <= -75, + f_pitch_curt = '上方' + ); + print(str('- 指向:§e%s,%s§a[%.1f,%.1f]',f_yaw_curt,f_pitch_curt,f_yaw,f_pitch)); + f_state = global_bot_state:f_player; + //潜行/疾跑/游泳 + inner_sneak = query(f_player,'sneaking'); + inner_sprint = query(f_player,'sprinting'); + inner_swim = query(f_player,'swimming'); +//*************************************************** + noAct = true; + //攻击/挖掘 + inner_attack = read_file(f_player + '-' + 'attack', 'text'):0; + if(inner_attack != null, + if(inner_attack == 0, + print('- 正在挖掘'); + noAct = false + ); + if(inner_attack > 0, + inner_sec = inner_attack/20; + print('- 每' + inner_attack + '游戏刻(' + inner_sec + '游戏秒)尝试攻击一次'); + noAct = false + ) + ); + //扔东西 + inner_drop = read_file(f_player + '-' + 'drop', 'text'):0; + if(inner_drop != null, + if(inner_drop == 0, + print('- 正在持续每次扔一个物品'); + noAct = false + ); + if(inner_drop > 0, + inner_sec = inner_drop/20; + print('- 每' + inner_drop + '游戏刻(' + inner_sec + '游戏秒)扔1个物品'); + noAct = false + ) + ); + inner_drop_stack = read_file(f_player + '-' + 'drop_stack', 'text'):0; + if(inner_drop_stack != null, + if(inner_drop_stack == 0, + print('- 正在持续每次扔一组物品'); + noAct = false + ); + if(inner_drop > 0, + inner_sec = inner_drop_stack/20; + print('- 每' + inner_drop_stack + '游戏刻(' + inner_sec + '游戏秒)扔1个物品'); + noAct = false + ) + ); + //跳跃 + inner_jump = read_file(f_player + '-' + 'jump', 'text'):0; + if(inner_jump != null, + if(inner_jump == 0, + print('- 正在持续跳跃'); + noAct = false + ); + if(inner_jump > 0, + inner_sec = inner_jump/20; + print('- 每' + inner_jump + '游戏刻(' + inner_sec + '游戏秒)尝试跳跃一次'); + noAct = false + ) + ); + //换手 + inner_swap_hands = read_file(f_player + '-' + 'swap_hands', 'text'):0; + if(inner_swap_hands != null, + if(inner_swap_hands == 0, + print('- 正在持续交换左右手的物品'); + noAct = false + ); + if(inner_swap_hands > 0, + inner_sec = inner_swap_hands/20; + print('- 每' + inner_swap_hands + '游戏刻(' + inner_sec + '游戏秒)交换一次左右手的物品'); + noAct = false + ) + ); + //使用物品 + inner_use = read_file(f_player + '-' + 'use', 'text'):0; + if(inner_use != null, + if(inner_use == 0, + print('- 正在持续使♂用物品'); + noAct = false + ); + if(inner_use > 0, + inner_sec = inner_use/20; + print('- 每' + inner_use + '游戏刻(' + inner_sec + '游戏秒)尝试使用一次物♂品'); + noAct = false + ) + ); + //移动**********************************重点********************************* + inner_move_vertical = read_file(f_player + '-' + 'move_vertical', 'text'):0; + inner_move_transverse = read_file(f_player + '-' + 'move_transverse', 'text'):0; + if(inner_sneak == true, + if(inner_move_vertical == 'forward', + if(inner_move_transverse == 'right', + print('- 正在向右前方潜行↗'); + noAct = false + ); + if(inner_move_transverse == 'left', + print('- 正在向左前方潜行↖'); + noAct = false + ); + if(inner_move_transverse == null, + print('- 正在向前潜行↑'); + noAct = false + ) + ); + if(inner_move_vertical == 'backward', + if(inner_move_transverse == 'right', + print('- 正在向右后方潜行↘'); + noAct = false + ); + if(inner_move_transverse == 'left', + print('- 正在向左后方潜行↙'); + noAct = false + ); + if(inner_move_transverse == null, + print('- 正在向后潜行↓'); + noAct = false + ) + ); + if(inner_move_vertical == null, + if(inner_move_transverse == 'right', + print('- 正在向右潜行→'); + noAct = false + ); + if(inner_move_transverse == 'left', + print('- 正在向左潜行←'); + noAct = false + ); + if(inner_move_transverse == null, + print('- 正在潜伏'); + noAct = false + ) + ) + ); + if(inner_sprint == true, + if(inner_swim == true, + if(inner_move_vertical == 'forward', + if(inner_move_transverse == 'right', + print('- 正在向右前方游泳↗'); + noAct = false + ); + if(inner_move_transverse == 'left', + print('- 正在向左前方游泳↖'); + noAct = false + ); + if(inner_move_transverse == null, + print('- 正在向前游泳↑'); + noAct = false + ) + ); + if(inner_move_vertical == 'backward', + if(inner_move_transverse == 'right', + print('- 正在向右后方游泳↘§e(没错它可以开挂)'); + noAct = false + ); + if(inner_move_transverse == 'left', + print('- 正在向左后方游泳↙§e(没错它可以开挂)'); + noAct = false + ); + if(inner_move_transverse == null, + print('- 正在向后游泳↓§e(没错它可以开挂)'); + noAct = false + ) + ); + if(inner_move_vertical == null, + if(inner_move_transverse == 'right', + print('- 正在向右游泳→§e(没错它可以开挂)'); + noAct = false + ); + if(inner_move_transverse == 'left', + print('- 正在向左游泳←§e(没错它可以开挂)'); + noAct = false + ); + if(inner_move_transverse == null, + print('- 正在原地游泳↓§e(没错它可以开挂)'); + noAct = false + ) + ) + ); + if(inner_swim == false, + if(inner_move_vertical == 'forward', + if(inner_move_transverse == 'right', + print('- 正在向右前方疾跑↗'); + noAct = false + ); + if(inner_move_transverse == 'left', + print('- 正在向左前方疾跑↖'); + noAct = false + ); + if(inner_move_transverse == null, + print('- 正在向前疾跑↑'); + noAct = false + ) + ); + if(inner_move_vertical == 'backward', + if(inner_move_transverse == 'right', + print('- 正在向右后方疾跑↘§e(没错它可以开挂)'); + noAct = false + ); + if(inner_move_transverse == 'left', + print('- 正在向左后方疾跑↙§e(没错它可以开挂)'); + noAct = false + ); + if(inner_move_transverse == null, + print('- 正在向后疾跑↓§e(没错它可以开挂)'); + noAct = false + ) + ); + if(inner_move_vertical == null, + if(inner_move_transverse == 'right', + print('- 正在向右疾跑→§e(没错它可以开挂)'); + noAct = false + ); + if(inner_move_transverse == 'left', + print('- 正在向左疾跑←§e(没错它可以开挂)'); + noAct = false + ); + if(inner_move_transverse == null, + print('- 正在原地疾跑,§e(没错它可以开挂)'); + noAct = false + ) + ) + ); + ); + if(inner_sprint == false && inner_sneak == false, + if(inner_move_vertical == 'forward', + if(inner_move_transverse == 'right', + print('- 正在向右前方走↗'); + noAct = false + ); + if(inner_move_transverse == 'left', + print('- 正在向左前方走↖'); + noAct = false + ); + if(inner_move_transverse == null, + print('- 正在向前走↑'); + noAct = false + ) + ); + if(inner_move_vertical == 'backward', + if(inner_move_transverse == 'right', + print('- 正在向右后方走↘'); + noAct = false + ); + if(inner_move_transverse == 'left', + print('- 正在向左后方走↙'); + noAct = false + ); + if(inner_move_transverse == null, + print('- 正在向后走↓'); + noAct = false + ) + ); + if(inner_move_vertical == null, + if(inner_move_transverse == 'right', + print('- 正在向右走→'); + noAct = false + ); + if(inner_move_transverse == 'left', + print('- 正在向左走←'); + noAct = false + ) + ) + ); + //乘坐 + inner_mount = f_player~'mount'; + if(inner_mount != null, + if(inner_mount == 'horse', + print('- 正在骑马') + ); + if(inner_mount == 'donkey', + print('- 正在骑驴') + ); + if(inner_mount == 'mule', + print('- 正在骑骡') + ); + if(inner_mount == 'trader_llama', + print('- 正在骑羊驼') + ); + if(inner_mount == 'pig', + print('- 正在骑猪') + ); + if(inner_mount == 'skeleton_horse', + print('- 正在骑骷髅马') + ); + if(inner_mount == 'zombie_horse', + print('- 正在骑僵尸马') + ); + noAct = false + ); + if(noAct == true, + print('- 无地毯动作') + ); + return() +); +checkall() ->( + player_list = player('all'); + c_for(i = 0, i < length(player_list), i += 1, + check(player_list:i); + ); + return() +); +run(str('tellraw @a {"text": "[版本信息]' + global_filename + '版本: ' + global_version + '", "color": "#ffd900"}')); +run(str('tellraw @a {"text": "[版本信息]carpet版本: ' + global_carpet_version:0 + '", "color": "#ffd900"}')); +if(number(global_carpet_version:1) < global_require_carpet_version:1 || global_carpet_version == null, + run(str('tellraw @a {"text": "[错误]' + global_filename + '需要地毯' + global_require_carpet_version:0 + '或以上来运行!否则会出现预期之外的问题", "color": "#ff6100"}');) ); \ No newline at end of file