修复挖掘榜失效的bug
This commit is contained in:
parent
c305885777
commit
40088893b5
@ -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"
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"parent": "fzsd:game_event",
|
||||
"criteria": {
|
||||
"on_tools_used_on_block": {
|
||||
"on_tools_exclude_axes_used_on_block": {
|
||||
"__comment": "斧子剥树皮会触发两次!",
|
||||
"trigger": "minecraft:item_used_on_block",
|
||||
"conditions": {
|
||||
@ -12,7 +12,7 @@
|
||||
}
|
||||
],
|
||||
"item": {
|
||||
"tag": "fzsd:tools"
|
||||
"tag": "fzsd:tools_exclude_axes"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
# 调用者: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": "在方块上使用了工具"}]
|
||||
@ -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
|
||||
|
||||
## 重置事件进度
|
||||
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
|
@ -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_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.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
|
@ -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_hoe 0
|
||||
scoreboard players set @s fzsd.event.used_tool.diamond_pickaxe 0
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
|
||||
]
|
||||
}
|
10
data/fzsd/tags/items/tools_exclude_axes.json
Normal file
10
data/fzsd/tags/items/tools_exclude_axes.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"#fzsd:tool/hoes",
|
||||
"#fzsd:tool/pickaxes",
|
||||
"#fzsd:tool/shears",
|
||||
"#fzsd:tool/shovels",
|
||||
"#fzsd:tool/swords"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user