修复挖掘榜失效的bug

This commit is contained in:
延皓 2022-09-02 10:36:03 +08:00
parent c305885777
commit 40088893b5
7 changed files with 44 additions and 7 deletions

View File

@ -0,0 +1,28 @@
{
"parent": "fzsd:game_event",
"criteria": {
"on_tools_exclude_axes_used_on_block": {
"trigger": "minecraft:item_used_on_block",
"conditions": {
"player": [
{
"condition": "minecraft:reference",
"name": "fzsd:is_real_player"
}
],
"item": {
"tag": "fzsd:tool/axes"
},
"location": {
"__comment": "斧子剥树皮会触发两次,所以用目标方块限定只触发一次",
"block": {
"tag": "fzsd:stripped_blocks"
}
}
}
}
},
"rewards": {
"function": "fzsd:game_event/advancement/on_tools_used_on_block"
}
}

View File

@ -1,7 +1,7 @@
{ {
"parent": "fzsd:game_event", "parent": "fzsd:game_event",
"criteria": { "criteria": {
"on_tools_used_on_block": { "on_tools_exclude_axes_used_on_block": {
"__comment": "斧子剥树皮会触发两次!", "__comment": "斧子剥树皮会触发两次!",
"trigger": "minecraft:item_used_on_block", "trigger": "minecraft:item_used_on_block",
"conditions": { "conditions": {
@ -12,7 +12,7 @@
} }
], ],
"item": { "item": {
"tag": "fzsd:tools" "tag": "fzsd:tools_exclude_axes"
} }
} }
} }

View File

@ -1,5 +1,4 @@
# 调用者advancements/fzsd:~ # 调用者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 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": "在方块上使用了工具"}]
@ -11,4 +10,5 @@ scoreboard players remove @s fzsd.event.used_tool.dig_offset 1
function #fzsd:game_event/player/on_tools_used_on_block function #fzsd:game_event/player/on_tools_used_on_block
## 重置事件进度 ## 重置事件进度
advancement revoke @s only fzsd:game_event/on_tools_used_on_block advancement revoke @s only fzsd:game_event/on_tool_axes_used_on_block
advancement revoke @s only fzsd:game_event/on_tools_exclude_axes_used_on_block

View File

@ -30,7 +30,7 @@ scoreboard players operation fzsd.var.score fzsd.variable.integer += @s fzsd.eve
scoreboard players operation fzsd.var.score fzsd.variable.integer += @s fzsd.event.used_tool.wooden_pickaxe scoreboard players operation fzsd.var.score fzsd.variable.integer += @s fzsd.event.used_tool.wooden_pickaxe
scoreboard players operation fzsd.var.score fzsd.variable.integer += @s fzsd.event.used_tool.wooden_shovel scoreboard players operation fzsd.var.score fzsd.variable.integer += @s fzsd.event.used_tool.wooden_shovel
scoreboard players operation fzsd.var.score fzsd.variable.integer += @s fzsd.event.used_tool.wooden_sword scoreboard players operation fzsd.var.score fzsd.variable.integer += @s fzsd.event.used_tool.wooden_sword
scoreboard players operation fzsd.var.score fzsd.variable.integer += @s fzsd.event.used_tool.offset scoreboard players operation fzsd.var.score fzsd.variable.integer += @s fzsd.event.used_tool.dig_offset
## 判断分数 ## 判断分数
execute unless score fzsd.var.score fzsd.variable.integer matches ..0 run function fzsd:game_event/player/on_broke_block_with_tool execute unless score fzsd.var.score fzsd.variable.integer matches ..0 run function fzsd:game_event/player/on_broke_block_with_tool

View File

@ -1,4 +1,4 @@
scoreboard players set @s fzsd.event.used_tool.offset 0 scoreboard players set @s fzsd.event.used_tool.dig_offset 0
scoreboard players set @s fzsd.event.used_tool.diamond_axe 0 scoreboard players set @s fzsd.event.used_tool.diamond_axe 0
scoreboard players set @s fzsd.event.used_tool.diamond_hoe 0 scoreboard players set @s fzsd.event.used_tool.diamond_hoe 0
scoreboard players set @s fzsd.event.used_tool.diamond_pickaxe 0 scoreboard players set @s fzsd.event.used_tool.diamond_pickaxe 0

View File

@ -1,6 +1,5 @@
{ {
"replace": false, "replace": false,
"values": [ "values": [
] ]
} }

View File

@ -0,0 +1,10 @@
{
"replace": false,
"values": [
"#fzsd:tool/hoes",
"#fzsd:tool/pickaxes",
"#fzsd:tool/shears",
"#fzsd:tool/shovels",
"#fzsd:tool/swords"
]
}