From 8afd7410d51536cd462b3f1532fbbc753bf5e690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=B6=E7=9A=93?= <8511461+harvey-husky@user.noreply.gitee.com> Date: Tue, 10 Jan 2023 01:01:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BE=E7=BD=AE=E6=A6=9C=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=E6=B5=81=E4=BD=93=EF=BC=8C=E9=81=BF=E5=85=8D=E8=BF=9E=E7=82=B9?= =?UTF-8?q?=E5=99=A8=E5=88=B7=E6=A6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../on_placed_block/on_placed_liquid.json | 13 +++++++++++++ .../advancement/on_placed_block.mcfunction | 5 ++--- .../game_event/callback/on_placed_liquid.mcfunction | 2 ++ .../game_event/callback/on_placed_solid.mcfunction | 2 ++ .../game_event/player/on_placed_block.json | 1 - .../game_event/player/on_placed_liquid.json | 6 ++++++ .../game_event/player/on_placed_solid.json | 7 +++++++ data/fzsd/tags/items/bucket_of_liquid.json | 8 ++++++++ data/fzsd/tags/items/bucket_of_mob.json | 11 +++++++++++ 9 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 data/fzsd/advancements/game_event/on_placed_block/on_placed_liquid.json create mode 100644 data/fzsd/functions/game_event/callback/on_placed_liquid.mcfunction create mode 100644 data/fzsd/functions/game_event/callback/on_placed_solid.mcfunction create mode 100644 data/fzsd/tags/functions/game_event/player/on_placed_liquid.json create mode 100644 data/fzsd/tags/functions/game_event/player/on_placed_solid.json create mode 100644 data/fzsd/tags/items/bucket_of_liquid.json create mode 100644 data/fzsd/tags/items/bucket_of_mob.json diff --git a/data/fzsd/advancements/game_event/on_placed_block/on_placed_liquid.json b/data/fzsd/advancements/game_event/on_placed_block/on_placed_liquid.json new file mode 100644 index 0000000..761c63d --- /dev/null +++ b/data/fzsd/advancements/game_event/on_placed_block/on_placed_liquid.json @@ -0,0 +1,13 @@ +{ + "parent": "fzsd:game_event/on_placed_block", + "criteria": { + "on_placed_liquid": { + "trigger": "minecraft:placed_block", + "conditions": { + "item": { + "tag": "fzsd:bucket_of_liquid" + } + } + } + } +} \ No newline at end of file diff --git a/data/fzsd/functions/game_event/advancement/on_placed_block.mcfunction b/data/fzsd/functions/game_event/advancement/on_placed_block.mcfunction index 9b2d63a..fc7e9f0 100644 --- a/data/fzsd/functions/game_event/advancement/on_placed_block.mcfunction +++ b/data/fzsd/functions/game_event/advancement/on_placed_block.mcfunction @@ -1,9 +1,8 @@ # 调用者:advancements/fzsd:~ -## 调试 -execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{"nbt": "fzsd.level.debug", "interpret": true, "storage": "fzsd:logger"}, {"text": "事件已触发:玩家"}, {"selector": "@s"}, {"text": "放置了方块"}] - ## 运行事件 +execute if entity @s[advancements={fzsd:game_event/on_placed_block/on_placed_liquid=true}] run function #fzsd:game_event/player/on_placed_liquid +execute if entity @s[advancements={fzsd:game_event/on_placed_block/on_placed_liquid=false}] run function #fzsd:game_event/player/on_placed_solid function #fzsd:game_event/player/on_placed_block ## 重置事件进度 diff --git a/data/fzsd/functions/game_event/callback/on_placed_liquid.mcfunction b/data/fzsd/functions/game_event/callback/on_placed_liquid.mcfunction new file mode 100644 index 0000000..70a52a1 --- /dev/null +++ b/data/fzsd/functions/game_event/callback/on_placed_liquid.mcfunction @@ -0,0 +1,2 @@ +## 调试 +execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{"nbt": "fzsd.level.debug", "interpret": true, "storage": "fzsd:logger"}, {"text": "事件已触发:玩家"}, {"selector": "@s"}, {"text": "放置了流体"}] \ No newline at end of file diff --git a/data/fzsd/functions/game_event/callback/on_placed_solid.mcfunction b/data/fzsd/functions/game_event/callback/on_placed_solid.mcfunction new file mode 100644 index 0000000..8886c41 --- /dev/null +++ b/data/fzsd/functions/game_event/callback/on_placed_solid.mcfunction @@ -0,0 +1,2 @@ +## 调试 +execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{"nbt": "fzsd.level.debug", "interpret": true, "storage": "fzsd:logger"}, {"text": "事件已触发:玩家"}, {"selector": "@s"}, {"text": "放置了实体方块"}] \ No newline at end of file diff --git a/data/fzsd/tags/functions/game_event/player/on_placed_block.json b/data/fzsd/tags/functions/game_event/player/on_placed_block.json index 5210f29..a1dc310 100644 --- a/data/fzsd/tags/functions/game_event/player/on_placed_block.json +++ b/data/fzsd/tags/functions/game_event/player/on_placed_block.json @@ -1,6 +1,5 @@ { "replace": false, "values": [ - "#fzsd:module/scoreboard/assign/scoreboard/placement_count" ] } \ No newline at end of file diff --git a/data/fzsd/tags/functions/game_event/player/on_placed_liquid.json b/data/fzsd/tags/functions/game_event/player/on_placed_liquid.json new file mode 100644 index 0000000..a4f2eea --- /dev/null +++ b/data/fzsd/tags/functions/game_event/player/on_placed_liquid.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fzsd:game_event/callback/on_placed_liquid" + ] +} \ No newline at end of file diff --git a/data/fzsd/tags/functions/game_event/player/on_placed_solid.json b/data/fzsd/tags/functions/game_event/player/on_placed_solid.json new file mode 100644 index 0000000..1b6d87d --- /dev/null +++ b/data/fzsd/tags/functions/game_event/player/on_placed_solid.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "fzsd:game_event/callback/on_placed_solid", + "#fzsd:module/scoreboard/assign/scoreboard/placement_count" + ] +} \ No newline at end of file diff --git a/data/fzsd/tags/items/bucket_of_liquid.json b/data/fzsd/tags/items/bucket_of_liquid.json new file mode 100644 index 0000000..83463e8 --- /dev/null +++ b/data/fzsd/tags/items/bucket_of_liquid.json @@ -0,0 +1,8 @@ +{ + "replace": false, + "values": [ + "minecraft:lava_bucket", + "minecraft:water_bucket", + "#fzsd:bucket_of_mob" + ] +} \ No newline at end of file diff --git a/data/fzsd/tags/items/bucket_of_mob.json b/data/fzsd/tags/items/bucket_of_mob.json new file mode 100644 index 0000000..15cd1a1 --- /dev/null +++ b/data/fzsd/tags/items/bucket_of_mob.json @@ -0,0 +1,11 @@ +{ + "replace": false, + "values": [ + "minecraft:cod_bucket", + "minecraft:salmon_bucket", + "minecraft:axolotl_bucket", + "minecraft:pufferfish_bucket", + "minecraft:powder_snow_bucket", + "minecraft:tropical_fish_bucket" + ] +} \ No newline at end of file