扫地机~
This commit is contained in:
parent
51402bd33d
commit
010ba03f41
@ -1,4 +1,4 @@
|
|||||||
execute store success storage fzsd:version fzsd.need_update int 1 run data merge storage fzsd:version {fzsd: {version: '3.0.5'}}
|
execute store success storage fzsd:version fzsd.need_update int 1 run data merge storage fzsd:version {fzsd: {version: '3.0.7'}}
|
||||||
execute if data storage fzsd:version fzsd{need_update: 1} run function fzsd:system/update
|
execute if data storage fzsd:version fzsd{need_update: 1} run function fzsd:system/update
|
||||||
function fzsd:system/carpet/try_load_fzsd_score
|
function fzsd:system/carpet/try_load_fzsd_score
|
||||||
function #fzsd:load
|
function #fzsd:load
|
||||||
|
1
data/fzsd/functions/module/health/try_install.mcfunction
Normal file
1
data/fzsd/functions/module/health/try_install.mcfunction
Normal file
@ -0,0 +1 @@
|
|||||||
|
execute unless data storage fzsd:install fzsd.module{health:0b} run function #fzsd:module/health/install
|
1
data/fzsd/functions/module/here/try_install.mcfunction
Normal file
1
data/fzsd/functions/module/here/try_install.mcfunction
Normal file
@ -0,0 +1 @@
|
|||||||
|
execute unless data storage fzsd:install fzsd.module{here:0b} run function #fzsd:module/here/install
|
@ -1,4 +1,4 @@
|
|||||||
## 运行事件
|
## 运行事件
|
||||||
function #fzsd:module/interactor/event/on_click
|
function #fzsd:module/interactor/event/on_click
|
||||||
## 触发器分数为正数时重新显示交互器按钮,为负数时不显示
|
## 触发器分数为正数时重新显示交互器按钮,为负数时不显示
|
||||||
execute if score @s fzsd.module.interactor.trigger matches 1.. run function #fzsd:module/interactor/display
|
execute if score @s fzsd.module.interactor.trigger matches 1.. run function #fzsd:module/interactor/event/on_display
|
@ -0,0 +1 @@
|
|||||||
|
execute unless data storage fzsd:install fzsd.module{interactor:0b} run function #fzsd:module/interactor/install
|
@ -0,0 +1 @@
|
|||||||
|
execute unless data storage fzsd:install fzsd.module{join_message:0b} run function #fzsd:module/join_message/install
|
@ -0,0 +1 @@
|
|||||||
|
execute unless data storage fzsd:install fzsd.module{last_nether_portal:0b} run function #fzsd:module/last_nether_portal/install
|
@ -0,0 +1 @@
|
|||||||
|
execute unless data storage fzsd:install fzsd.module{last_spawn_point:0b} run function #fzsd:module/last_spawn_point/install
|
@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
execute if data storage fzsd:install fzsd.module{scoreboard:1b} run tellraw @s {"text": "计分板:"}
|
execute if data storage fzsd:install fzsd.module{scoreboard:1b} run tellraw @s {"text": "计分板:"}
|
||||||
|
|
||||||
execute if data storage fzsd:install fzsd.module{scoreboard:1b} run tellraw @s [[{"text": "[", "color": "dark_gray", "hoverEvent": {"action": "show_text", "contents": {"text": "关", "color": "dark_red"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1000"}}, {"text": "关", "color": "dark_red"}, {"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.carousel", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1010"}}, {"nbt": "fzsd.scoreboard.text.carousel", "interpret": true, "storage": "fzsd:module"}, {"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.general", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1020"}}, {"nbt": "fzsd.scoreboard.text.general", "interpret": true, "storage": "fzsd:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.activation", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1030"}}, {"nbt": "fzsd.scoreboard.text.activation", "interpret": true, "storage": "fzsd:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.aviating_distance", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1040"}}, {"nbt": "fzsd.scoreboard.text.aviating_distance", "interpret": true, "storage": "fzsd:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.damage_taken", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1050"}}, {"nbt": "fzsd.scoreboard.text.damage_taken", "interpret": true, "storage": "fzsd:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.death_count", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1060"}}, {"nbt": "fzsd.scoreboard.text.death_count", "interpret": true, "storage": "fzsd:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.dig_count", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1070"}}, {"nbt": "fzsd.scoreboard.text.dig_count", "interpret": true, "storage": "fzsd:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.fishing_count", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1080"}}, {"nbt": "fzsd.scoreboard.text.fishing_count", "interpret": true, "storage": "fzsd:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.kill_count", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1090"}}, {"nbt": "fzsd.scoreboard.text.kill_count", "interpret": true, "storage": "fzsd:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.trade_count", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1100"}}, {"nbt": "fzsd.scoreboard.text.trade_count", "interpret": true, "storage": "fzsd:module"}, {"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.placement_count", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1200"}}, {"nbt": "fzsd.scoreboard.text.placement_count", "interpret": true, "storage": "fzsd:module"}, {"text": "]"}]]
|
execute if data storage fzsd:install fzsd.module{scoreboard:1b} run tellraw @s [[{"text": "[", "color": "dark_gray", "hoverEvent": {"action": "show_text", "contents": {"text": "关", "color": "dark_red"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1000"}}, {"text": "关", "color": "red"}, {"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.carousel", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1010"}}, {"nbt": "fzsd.scoreboard.text.carousel", "interpret": true, "storage": "fzsd:module"}, {"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.general", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1020"}}, {"nbt": "fzsd.scoreboard.text.general", "interpret": true, "storage": "fzsd:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.activation", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1030"}}, {"nbt": "fzsd.scoreboard.text.activation", "interpret": true, "storage": "fzsd:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.aviating_distance", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1040"}}, {"nbt": "fzsd.scoreboard.text.aviating_distance", "interpret": true, "storage": "fzsd:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.damage_taken", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1050"}}, {"nbt": "fzsd.scoreboard.text.damage_taken", "interpret": true, "storage": "fzsd:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.death_count", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1060"}}, {"nbt": "fzsd.scoreboard.text.death_count", "interpret": true, "storage": "fzsd:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.dig_count", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1070"}}, {"nbt": "fzsd.scoreboard.text.dig_count", "interpret": true, "storage": "fzsd:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.fishing_count", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1080"}}, {"nbt": "fzsd.scoreboard.text.fishing_count", "interpret": true, "storage": "fzsd:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.kill_count", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1090"}}, {"nbt": "fzsd.scoreboard.text.kill_count", "interpret": true, "storage": "fzsd:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.trade_count", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1100"}}, {"nbt": "fzsd.scoreboard.text.trade_count", "interpret": true, "storage": "fzsd:module"}, {"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fzsd.scoreboard.text.placement_count", "interpret": true, "storage": "fzsd:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -1200"}}, {"nbt": "fzsd.scoreboard.text.placement_count", "interpret": true, "storage": "fzsd:module"}, {"text": "]"}]]
|
@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
execute unless data storage fzsd:install fzsd.module{scoreboard:0b} run function #fzsd:module/scoreboard/install
|
4
data/fzsd/functions/module/sweeper/bossbar.mcfunction
Normal file
4
data/fzsd/functions/module/sweeper/bossbar.mcfunction
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bossbar set fzsd:sweeper name [{"score": {"objective": "fzsd.variable.integer", "name": "fzsd.sweeper.bossbar.current_time"},"color": "#ff6100","underlined": true,"bold": true},{"text": "秒后清理掉落物","color": "#ffd900","bold": false}]
|
||||||
|
bossbar set fzsd:sweeper players @a[tag=!fzsd.ignore_sweeper_bossbar]
|
||||||
|
scoreboard players remove fzsd.sweeper.bossbar.current_time fzsd.variable.integer 1
|
||||||
|
schedule function fzsd:module/sweeper/bossbar 1s
|
15
data/fzsd/functions/module/sweeper/clear.mcfunction
Normal file
15
data/fzsd/functions/module/sweeper/clear.mcfunction
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
schedule clear fzsd:module/sweeper/bossbar
|
||||||
|
schedule clear fzsd:module/sweeper/main
|
||||||
|
schedule clear fzsd:module/sweeper/timer/1s
|
||||||
|
schedule clear fzsd:module/sweeper/timer/2s
|
||||||
|
schedule clear fzsd:module/sweeper/timer/3s
|
||||||
|
schedule clear fzsd:module/sweeper/timer/4s
|
||||||
|
schedule clear fzsd:module/sweeper/timer/5s
|
||||||
|
schedule clear fzsd:module/sweeper/timer/10s
|
||||||
|
schedule clear fzsd:module/sweeper/timer/30s
|
||||||
|
schedule clear fzsd:module/sweeper/timer/1min
|
||||||
|
schedule clear fzsd:module/sweeper/timer/2min
|
||||||
|
schedule clear fzsd:module/sweeper/timer/3min
|
||||||
|
schedule clear fzsd:module/sweeper/timer/4min
|
||||||
|
bossbar set fzsd:sweeper visible false
|
||||||
|
bossbar set fzsd:sweeper value 0
|
8
data/fzsd/functions/module/sweeper/install.mcfunction
Normal file
8
data/fzsd/functions/module/sweeper/install.mcfunction
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
bossbar add fzsd:sweeper ""
|
||||||
|
bossbar set fzsd:sweeper max 60
|
||||||
|
|
||||||
|
## 标记为已安装
|
||||||
|
data modify storage fzsd:install fzsd.module.sweeper set value 1b
|
||||||
|
|
||||||
|
## 日志
|
||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..500 run tellraw @a [{"nbt": "fzsd.level.info", "interpret": true, "storage": "fzsd:logger"}, {"text": "已安装组件:扫地机"}]
|
@ -0,0 +1,2 @@
|
|||||||
|
# 调用者:#fzsd:module/sweeper/interactor/display
|
||||||
|
execute if data storage fzsd:install fzsd.module{sweeper:1b} run function fzsd:module/sweeper/interactor/display_0
|
@ -0,0 +1,12 @@
|
|||||||
|
tellraw @s [{"text": "扫地机:"}]
|
||||||
|
|
||||||
|
tellraw @s[tag=!fzsd.ignore_sweeper_bossbar] [{"text": "- 血条栏:"}, [{"text": "[", "color": "gray", "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set 3400"}}, {"text": "已开启", "color": "green"}, {"text": "]", "color": "gray"}]]
|
||||||
|
tellraw @s[tag=fzsd.ignore_sweeper_bossbar] [{"text": "- 血条栏:"}, [{"text": "[", "color": "gray", "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set 3401"}}, {"text": "已关闭", "color": "red"}, {"text": "]", "color": "gray"}]]
|
||||||
|
|
||||||
|
tellraw @s[tag=!fzsd.ignore_sweeper_sound] [{"text": "- 音效:"}, [{"text": "[", "color": "gray", "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set 3500"}}, {"text": "已开启", "color": "green"}, {"text": "]", "color": "gray"}]]
|
||||||
|
tellraw @s[tag=fzsd.ignore_sweeper_sound] [{"text": "- 音效:"}, [{"text": "[", "color": "gray", "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set 3501"}}, {"text": "已关闭", "color": "red"}, {"text": "]", "color": "gray"}]]
|
||||||
|
|
||||||
|
tellraw @s[tag=!fzsd.ignore_sweeper_message] [{"text": "- 消息:"}, [{"text": "[", "color": "gray", "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set 3600"}}, {"text": "已开启", "color": "green"}, {"text": "]", "color": "gray"}]]
|
||||||
|
tellraw @s[tag=fzsd.ignore_sweeper_message] [{"text": "- 消息:"}, [{"text": "[", "color": "gray", "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set 3601"}}, {"text": "已关闭", "color": "red"}, {"text": "]", "color": "gray"}]]
|
||||||
|
|
||||||
|
tellraw @s [{"text": "- 开关:"}, [{"text": "[", "color": "dark_gray", "hoverEvent": {"action": "show_text", "contents": {"text": "关", "color": "dark_red"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -3000"}}, {"text": "关", "color": "red"}, {"text": "]"}], [{"text": "[", "color": "gray", "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -3300"}}, {"text": "清理一次", "color": "aqua"}, {"text": "]", "color": "gray"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"text": "10s", "color": "#aa0000"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -3010"}}, {"text": "10s", "color": "#aa0000"}, {"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"text": "30s", "color": "#da7924"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -3030"}}, {"text": "30s", "color": "#da7924"}, {"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"text": "1min", "color": "#ffe34c"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -3060"}}, {"text": "1min", "color": "#ffe34c"}, {"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"text": "2min", "color": "#e3ff50"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -3120"}}, {"text": "2min", "color": "#e3ff50"}, {"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"text": "3min", "color": "#81d42c"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -3180"}}, {"text": "3min", "color": "#81d42c"}, {"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"text": "4min", "color": "#00aa00"}}, "clickEvent": {"action": "run_command", "value": "/trigger fzsd.module.interactor.trigger set -3240"}}, {"text": "4min", "color": "#00aa00"}, {"text": "]"}]]
|
@ -0,0 +1,9 @@
|
|||||||
|
execute if score @s fzsd.module.interactor.trigger matches 3400 run tag @s add fzsd.ignore_sweeper_bossbar
|
||||||
|
execute if score @s fzsd.module.interactor.trigger matches 3401 run tag @s remove fzsd.ignore_sweeper_bossbar
|
||||||
|
execute if score @s fzsd.module.interactor.trigger matches 3500 run tag @s add fzsd.ignore_sweeper_sound
|
||||||
|
execute if score @s fzsd.module.interactor.trigger matches 3501 run tag @s remove fzsd.ignore_sweeper_sound
|
||||||
|
execute if score @s fzsd.module.interactor.trigger matches 3600 run tag @s add fzsd.ignore_sweeper_message
|
||||||
|
execute if score @s fzsd.module.interactor.trigger matches 3601 run tag @s remove fzsd.ignore_sweeper_message
|
||||||
|
execute if score @s fzsd.module.interactor.trigger matches -3300 run function #fzsd:module/sweeper/sweep
|
||||||
|
execute if score @s fzsd.module.interactor.trigger matches -3000 run function #fzsd:module/sweeper/stop_loop
|
||||||
|
execute if score @s fzsd.module.interactor.trigger matches -3240..-3010 run function #fzsd:module/sweeper/start_loop
|
4
data/fzsd/functions/module/sweeper/load.mcfunction
Normal file
4
data/fzsd/functions/module/sweeper/load.mcfunction
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
function fzsd:module/sweeper/clear
|
||||||
|
|
||||||
|
## 日志
|
||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..500 run tellraw @a [{"nbt": "fzsd.level.info", "interpret": true, "storage": "fzsd:logger"}, {"text": "已加载组件:扫地机"}]
|
3
data/fzsd/functions/module/sweeper/main.mcfunction
Normal file
3
data/fzsd/functions/module/sweeper/main.mcfunction
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
bossbar set fzsd:sweeper value 0
|
||||||
|
function #fzsd:module/sweeper/sweep
|
||||||
|
function fzsd:module/sweeper/start_timer
|
6
data/fzsd/functions/module/sweeper/post_loop.mcfunction
Normal file
6
data/fzsd/functions/module/sweeper/post_loop.mcfunction
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# 获取间隔时间
|
||||||
|
scoreboard players set fzsd.sweeper.interval_time fzsd.variable.integer 3000
|
||||||
|
scoreboard players operation fzsd.sweeper.interval_time fzsd.variable.integer += @s fzsd.module.interactor.trigger
|
||||||
|
scoreboard players operation fzsd.sweeper.interval_time fzsd.variable.integer *= -1 fzsd.variable.integer
|
||||||
|
# 设为显示
|
||||||
|
bossbar set fzsd:sweeper visible true
|
@ -0,0 +1,7 @@
|
|||||||
|
execute if score fzsd.sweeper.interval_time fzsd.variable.integer matches 10 run function fzsd:module/sweeper/timer/10s
|
||||||
|
execute if score fzsd.sweeper.interval_time fzsd.variable.integer matches 30 run function fzsd:module/sweeper/timer/30s
|
||||||
|
execute if score fzsd.sweeper.interval_time fzsd.variable.integer matches 60 run function fzsd:module/sweeper/timer/1min
|
||||||
|
execute if score fzsd.sweeper.interval_time fzsd.variable.integer matches 120 run function fzsd:module/sweeper/timer/2min
|
||||||
|
execute if score fzsd.sweeper.interval_time fzsd.variable.integer matches 180 run function fzsd:module/sweeper/timer/3min
|
||||||
|
execute if score fzsd.sweeper.interval_time fzsd.variable.integer matches 240 run function fzsd:module/sweeper/timer/4min
|
||||||
|
scoreboard players operation fzsd.sweeper.bossbar.current_time fzsd.variable.integer = fzsd.sweeper.interval_time fzsd.variable.integer
|
3
data/fzsd/functions/module/sweeper/sweep.mcfunction
Normal file
3
data/fzsd/functions/module/sweeper/sweep.mcfunction
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
execute store result score fzsd.sweeper.killed fzsd.variable.integer run kill @e[type=minecraft:item,predicate=!fzsd:sweeper/whitelist]
|
||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..600 run tellraw @a [{"nbt": "fzsd.level.alert", "interpret": true, "storage": "fzsd:logger"}, {"text": "本次共清理了"}, {"score": {"objective": "fzsd.variable.integer", "name": "fzsd.sweeper.killed"}}, {"text": "堆掉落物"}]
|
||||||
|
execute as @a[tag=!fzsd.ignore_sweeper_sound] at @s run playsound minecraft:block.note_block.pling voice @s ~ ~ ~ 1 2
|
5
data/fzsd/functions/module/sweeper/timer/10s.mcfunction
Normal file
5
data/fzsd/functions/module/sweeper/timer/10s.mcfunction
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..600 run tellraw @a[tag=!fzsd.ignore_sweeper_message] [{"nbt": "fzsd.level.alert", "interpret": true, "storage": "fzsd:logger"}, {"text": "10秒后清理掉落物"}]
|
||||||
|
execute as @a[tag=!fzsd.ignore_sweeper_sound] at @s run playsound minecraft:block.note_block.pling voice @s ~ ~ ~ 1 1
|
||||||
|
bossbar set fzsd:sweeper color yellow
|
||||||
|
bossbar set fzsd:sweeper value 10
|
||||||
|
schedule function fzsd:module/sweeper/timer/5s 5s
|
5
data/fzsd/functions/module/sweeper/timer/1min.mcfunction
Normal file
5
data/fzsd/functions/module/sweeper/timer/1min.mcfunction
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..600 run execute if score fzsd.logger.level fzsd.variable.integer matches ..600 run tellraw @a[tag=!fzsd.ignore_sweeper_message] [{"nbt": "fzsd.level.alert", "interpret": true, "storage": "fzsd:logger"}, {"text": "1分钟后清理掉落物"}]
|
||||||
|
execute as @a[tag=!fzsd.ignore_sweeper_sound] at @s run playsound minecraft:block.note_block.pling voice @s ~ ~ ~ 1 1
|
||||||
|
bossbar set fzsd:sweeper color yellow
|
||||||
|
bossbar set fzsd:sweeper value 60
|
||||||
|
schedule function fzsd:module/sweeper/timer/30s 30s
|
4
data/fzsd/functions/module/sweeper/timer/1s.mcfunction
Normal file
4
data/fzsd/functions/module/sweeper/timer/1s.mcfunction
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..600 run tellraw @a[tag=!fzsd.ignore_sweeper_message] [{"nbt": "fzsd.level.alert", "interpret": true, "storage": "fzsd:logger"}, {"text": "1秒后清理掉落物"}]
|
||||||
|
execute as @a[tag=!fzsd.ignore_sweeper_sound] at @s run playsound minecraft:block.note_block.pling voice @s ~ ~ ~ 1 1
|
||||||
|
bossbar set fzsd:sweeper value 12
|
||||||
|
schedule function fzsd:module/sweeper/main 1s
|
5
data/fzsd/functions/module/sweeper/timer/2min.mcfunction
Normal file
5
data/fzsd/functions/module/sweeper/timer/2min.mcfunction
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..600 run tellraw @a[tag=!fzsd.ignore_sweeper_message] [{"nbt": "fzsd.level.alert", "interpret": true, "storage": "fzsd:logger"}, {"text": "2分钟后清理掉落物"}]
|
||||||
|
execute as @a[tag=!fzsd.ignore_sweeper_sound] at @s run playsound minecraft:block.note_block.pling voice @s ~ ~ ~ 1 1
|
||||||
|
bossbar set fzsd:sweeper color green
|
||||||
|
bossbar set fzsd:sweeper value 30
|
||||||
|
schedule function fzsd:module/sweeper/timer/1min 60s
|
4
data/fzsd/functions/module/sweeper/timer/2s.mcfunction
Normal file
4
data/fzsd/functions/module/sweeper/timer/2s.mcfunction
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..600 run tellraw @a[tag=!fzsd.ignore_sweeper_message] [{"nbt": "fzsd.level.alert", "interpret": true, "storage": "fzsd:logger"}, {"text": "2秒后清理掉落物"}]
|
||||||
|
execute as @a[tag=!fzsd.ignore_sweeper_sound] at @s run playsound minecraft:block.note_block.pling voice @s ~ ~ ~ 1 1
|
||||||
|
bossbar set fzsd:sweeper value 24
|
||||||
|
schedule function fzsd:module/sweeper/timer/1s 1s
|
5
data/fzsd/functions/module/sweeper/timer/30s.mcfunction
Normal file
5
data/fzsd/functions/module/sweeper/timer/30s.mcfunction
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..600 run tellraw @a[tag=!fzsd.ignore_sweeper_message] [{"nbt": "fzsd.level.alert", "interpret": true, "storage": "fzsd:logger"}, {"text": "30秒后清理掉落物"}]
|
||||||
|
execute as @a[tag=!fzsd.ignore_sweeper_sound] at @s run playsound minecraft:block.note_block.pling voice @s ~ ~ ~ 1 1
|
||||||
|
bossbar set fzsd:sweeper color yellow
|
||||||
|
bossbar set fzsd:sweeper value 30
|
||||||
|
schedule function fzsd:module/sweeper/timer/10s 20s
|
5
data/fzsd/functions/module/sweeper/timer/3min.mcfunction
Normal file
5
data/fzsd/functions/module/sweeper/timer/3min.mcfunction
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..600 run tellraw @a[tag=!fzsd.ignore_sweeper_message] [{"nbt": "fzsd.level.alert", "interpret": true, "storage": "fzsd:logger"}, {"text": "3分钟后清理掉落物"}]
|
||||||
|
execute as @a[tag=!fzsd.ignore_sweeper_sound] at @s run playsound minecraft:block.note_block.pling voice @s ~ ~ ~ 1 1
|
||||||
|
bossbar set fzsd:sweeper color green
|
||||||
|
bossbar set fzsd:sweeper value 45
|
||||||
|
schedule function fzsd:module/sweeper/timer/2min 60s
|
4
data/fzsd/functions/module/sweeper/timer/3s.mcfunction
Normal file
4
data/fzsd/functions/module/sweeper/timer/3s.mcfunction
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..600 run tellraw @a[tag=!fzsd.ignore_sweeper_message] [{"nbt": "fzsd.level.alert", "interpret": true, "storage": "fzsd:logger"}, {"text": "3秒后清理掉落物"}]
|
||||||
|
execute as @a[tag=!fzsd.ignore_sweeper_sound] at @s run playsound minecraft:block.note_block.pling voice @s ~ ~ ~ 1 1
|
||||||
|
bossbar set fzsd:sweeper value 36
|
||||||
|
schedule function fzsd:module/sweeper/timer/2s 1s
|
5
data/fzsd/functions/module/sweeper/timer/4min.mcfunction
Normal file
5
data/fzsd/functions/module/sweeper/timer/4min.mcfunction
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..600 run tellraw @a[tag=!fzsd.ignore_sweeper_message] [{"nbt": "fzsd.level.alert", "interpret": true, "storage": "fzsd:logger"}, {"text": "4分钟后清理掉落物"}]
|
||||||
|
execute as @a[tag=!fzsd.ignore_sweeper_sound] at @s run playsound minecraft:block.note_block.pling voice @s ~ ~ ~ 1 1
|
||||||
|
bossbar set fzsd:sweeper color green
|
||||||
|
bossbar set fzsd:sweeper value 50
|
||||||
|
schedule function fzsd:module/sweeper/timer/3min 60s
|
4
data/fzsd/functions/module/sweeper/timer/4s.mcfunction
Normal file
4
data/fzsd/functions/module/sweeper/timer/4s.mcfunction
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..600 run tellraw @a[tag=!fzsd.ignore_sweeper_message] [{"nbt": "fzsd.level.alert", "interpret": true, "storage": "fzsd:logger"}, {"text": "4秒后清理掉落物"}]
|
||||||
|
execute as @a[tag=!fzsd.ignore_sweeper_sound] at @s run playsound minecraft:block.note_block.pling voice @s ~ ~ ~ 1 1
|
||||||
|
bossbar set fzsd:sweeper value 48
|
||||||
|
schedule function fzsd:module/sweeper/timer/3s 1s
|
5
data/fzsd/functions/module/sweeper/timer/5s.mcfunction
Normal file
5
data/fzsd/functions/module/sweeper/timer/5s.mcfunction
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..600 run tellraw @a[tag=!fzsd.ignore_sweeper_message] [{"nbt": "fzsd.level.alert", "interpret": true, "storage": "fzsd:logger"}, {"text": "5秒后清理掉落物"}]
|
||||||
|
execute as @a[tag=!fzsd.ignore_sweeper_sound] at @s run playsound minecraft:block.note_block.pling voice @s ~ ~ ~ 1 1
|
||||||
|
bossbar set fzsd:sweeper color red
|
||||||
|
bossbar set fzsd:sweeper value 60
|
||||||
|
schedule function fzsd:module/sweeper/timer/4s 1s
|
@ -0,0 +1 @@
|
|||||||
|
execute unless data storage fzsd:install fzsd.module{sweeper:0b} run function #fzsd:module/sweeper/install
|
2
data/fzsd/functions/module/sweeper/try_load.mcfunction
Normal file
2
data/fzsd/functions/module/sweeper/try_load.mcfunction
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
## 判断是否安装,如果安装则加载
|
||||||
|
execute if data storage fzsd:install fzsd.module{sweeper:1b} run function #fzsd:module/sweeper/load
|
7
data/fzsd/functions/module/sweeper/uninstall.mcfunction
Normal file
7
data/fzsd/functions/module/sweeper/uninstall.mcfunction
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
bossbar remove fzsd:sweeper
|
||||||
|
|
||||||
|
## 标记为已安装
|
||||||
|
data modify storage fzsd:install fzsd.module.sweeper set value 0b
|
||||||
|
|
||||||
|
## 日志
|
||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..500 run tellraw @a [{"nbt": "fzsd.level.info", "interpret": true, "storage": "fzsd:logger"}, {"text": "已卸载组件:扫地机"}]
|
@ -1,11 +0,0 @@
|
|||||||
# 调用者:#fzsd:module/try_install
|
|
||||||
|
|
||||||
## 判断是否需要安装
|
|
||||||
execute unless data storage fzsd:install fzsd.module{health:0b} run function #fzsd:module/health/install
|
|
||||||
execute unless data storage fzsd:install fzsd.module{here:0b} run function #fzsd:module/here/install
|
|
||||||
execute unless data storage fzsd:install fzsd.module{interactor:0b} run function #fzsd:module/interactor/install
|
|
||||||
execute unless data storage fzsd:install fzsd.module{join_message:0b} run function #fzsd:module/join_message/install
|
|
||||||
execute unless data storage fzsd:install fzsd.module{last_death:0b} run function #fzsd:module/last_death/install
|
|
||||||
execute unless data storage fzsd:install fzsd.module{last_nether_portal:0b} run function #fzsd:module/last_nether_portal/install
|
|
||||||
execute unless data storage fzsd:install fzsd.module{last_spawn_point:0b} run function #fzsd:module/last_spawn_point/install
|
|
||||||
execute unless data storage fzsd:install fzsd.module{scoreboard:0b} run function #fzsd:module/scoreboard/install
|
|
@ -1,4 +1,5 @@
|
|||||||
## 常量
|
## 常量
|
||||||
|
scoreboard players set -1 fzsd.variable.integer -1
|
||||||
scoreboard players set 10 fzsd.variable.integer 10
|
scoreboard players set 10 fzsd.variable.integer 10
|
||||||
scoreboard players set 200 fzsd.variable.integer 200
|
scoreboard players set 200 fzsd.variable.integer 200
|
||||||
scoreboard players set 72000 fzsd.variable.integer 72000
|
scoreboard players set 72000 fzsd.variable.integer 72000
|
7
data/fzsd/predicates/sweeper/whitelist.json
Normal file
7
data/fzsd/predicates/sweeper/whitelist.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"condition": "minecraft:entity_properties",
|
||||||
|
"entity": "this",
|
||||||
|
"predicate": {
|
||||||
|
"nbt": "{Item:{id:\"minecraft:minecart\"}}"
|
||||||
|
}
|
||||||
|
}
|
@ -5,6 +5,7 @@
|
|||||||
"#fzsd:module/scoreboard/interactor/on_click",
|
"#fzsd:module/scoreboard/interactor/on_click",
|
||||||
"#fzsd:module/here/interactor/on_click",
|
"#fzsd:module/here/interactor/on_click",
|
||||||
"#fzsd:module/last_nether_portal/interactor/on_click",
|
"#fzsd:module/last_nether_portal/interactor/on_click",
|
||||||
"#fzsd:module/last_spawn_point/interactor/on_click"
|
"#fzsd:module/last_spawn_point/interactor/on_click",
|
||||||
|
"#fzsd:module/sweeper/interactor/on_click"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -6,6 +6,7 @@
|
|||||||
"#fzsd:module/scoreboard/interactor/display",
|
"#fzsd:module/scoreboard/interactor/display",
|
||||||
"#fzsd:module/here/interactor/display",
|
"#fzsd:module/here/interactor/display",
|
||||||
"#fzsd:module/last_nether_portal/interactor/display",
|
"#fzsd:module/last_nether_portal/interactor/display",
|
||||||
"#fzsd:module/last_spawn_point/interactor/display"
|
"#fzsd:module/last_spawn_point/interactor/display",
|
||||||
|
"#fzsd:module/sweeper/interactor/display"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"replace": false,
|
"replace": false,
|
||||||
"values": [
|
"values": [
|
||||||
"#fzsd:module/interactor/display",
|
"#fzsd:module/interactor/event/on_display",
|
||||||
"#fzsd:module/interactor/reset_trigger"
|
"#fzsd:module/interactor/reset_trigger"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"fzsd:module/interactor/try_load"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"fzsd:module/scoreboard/try_load"
|
|
||||||
]
|
|
||||||
}
|
|
7
data/fzsd/tags/functions/module/sweeper/install.json
Normal file
7
data/fzsd/tags/functions/module/sweeper/install.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"__comment": "调用者:#fzsd:module/install",
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"fzsd:module/sweeper/install"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"fzsd:module/sweeper/interactor/display"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"fzsd:module/sweeper/interactor/on_click"
|
||||||
|
]
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"replace": false,
|
"replace": false,
|
||||||
"values": [
|
"values": [
|
||||||
|
"fzsd:module/sweeper/load"
|
||||||
]
|
]
|
||||||
}
|
}
|
9
data/fzsd/tags/functions/module/sweeper/start_loop.json
Normal file
9
data/fzsd/tags/functions/module/sweeper/start_loop.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"fzsd:module/sweeper/clear",
|
||||||
|
"fzsd:module/sweeper/post_loop",
|
||||||
|
"fzsd:module/sweeper/start_timer",
|
||||||
|
"fzsd:module/sweeper/bossbar"
|
||||||
|
]
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"replace": false,
|
"replace": false,
|
||||||
"values": [
|
"values": [
|
||||||
|
"fzsd:module/sweeper/clear"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"replace": false,
|
"replace": false,
|
||||||
"values": [
|
"values": [
|
||||||
"fzsd:module/health/try_load"
|
"fzsd:module/sweeper/sweep"
|
||||||
]
|
]
|
||||||
}
|
}
|
7
data/fzsd/tags/functions/module/sweeper/uninstall.json
Normal file
7
data/fzsd/tags/functions/module/sweeper/uninstall.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"__comment": "调用者:#fzsd:module/uninstall",
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"fzsd:module/sweeper/uninstall"
|
||||||
|
]
|
||||||
|
}
|
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"__comment": "调用者:fzsd:load",
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"fzsd:module/try_install"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"__comment": "调用者:fzsd:load",
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"#fzsd:module/health/try_load",
|
|
||||||
"#fzsd:module/interactor/try_load",
|
|
||||||
"#fzsd:module/scoreboard/try_load"
|
|
||||||
]
|
|
||||||
}
|
|
@ -4,9 +4,9 @@
|
|||||||
"#fzsd:module/health/install",
|
"#fzsd:module/health/install",
|
||||||
"#fzsd:module/here/install",
|
"#fzsd:module/here/install",
|
||||||
"#fzsd:module/interactor/install",
|
"#fzsd:module/interactor/install",
|
||||||
"#fzsd:module/last_death/install",
|
|
||||||
"#fzsd:module/last_nether_portal/install",
|
"#fzsd:module/last_nether_portal/install",
|
||||||
"#fzsd:module/last_spawn_point/install",
|
"#fzsd:module/last_spawn_point/install",
|
||||||
"#fzsd:module/scoreboard/install"
|
"#fzsd:module/scoreboard/install",
|
||||||
|
"#fzsd:module/sweeper/install"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -1,6 +1,13 @@
|
|||||||
{
|
{
|
||||||
"replace": false,
|
"replace": false,
|
||||||
"values": [
|
"values": [
|
||||||
"#fzsd:module/try_install"
|
"fzsd:module/health/try_install",
|
||||||
|
"fzsd:module/here/try_install",
|
||||||
|
"fzsd:module/interactor/try_install",
|
||||||
|
"fzsd:module/join_message/try_install",
|
||||||
|
"fzsd:module/last_nether_portal/try_install",
|
||||||
|
"fzsd:module/last_spawn_point/try_install",
|
||||||
|
"fzsd:module/scoreboard/try_install",
|
||||||
|
"fzsd:module/sweeper/try_install"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -1,6 +1,9 @@
|
|||||||
{
|
{
|
||||||
"replace": false,
|
"replace": false,
|
||||||
"values": [
|
"values": [
|
||||||
"#fzsd:module/try_load"
|
"fzsd:module/health/try_load",
|
||||||
|
"fzsd:module/interactor/try_load",
|
||||||
|
"fzsd:module/scoreboard/try_load",
|
||||||
|
"fzsd:module/sweeper/try_load"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -5,9 +5,9 @@
|
|||||||
"#fzsd:module/health/uninstall",
|
"#fzsd:module/health/uninstall",
|
||||||
"#fzsd:module/here/uninstall",
|
"#fzsd:module/here/uninstall",
|
||||||
"#fzsd:module/interactor/uninstall",
|
"#fzsd:module/interactor/uninstall",
|
||||||
"#fzsd:module/last_death/uninstall",
|
|
||||||
"#fzsd:module/last_nether_portal/uninstall",
|
"#fzsd:module/last_nether_portal/uninstall",
|
||||||
"#fzsd:module/last_spawn_point/uninstall",
|
"#fzsd:module/last_spawn_point/uninstall",
|
||||||
"#fzsd:module/scoreboard/uninstall"
|
"#fzsd:module/scoreboard/uninstall",
|
||||||
|
"#fzsd:module/sweeper/uninstall"
|
||||||
]
|
]
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user