fz-survival-datapack/data/fz/functions/module/scoreboard/load.mcfunction

31 lines
4.1 KiB
Mcfunction
Raw Normal View History

2022-06-23 15:43:39 +08:00
# 调用者:#fz:module/scoreboard/load
## 异常检测
2022-06-27 16:06:15 +08:00
execute unless data storage fz:install_manager fz.module{scoreboard: 1b} run tellraw @a [{"nbt": "fz.exception.load_without_install_exception", "interpret": true, "storage": "fz:logger"}, {"text": "计分板"}]
## 调试
execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "计分板显示文本已设为:"}]
execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"text": "", "color": "green"}, {"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "fz.module.scoreboard.display.general - "}, {"nbt": "fz.scoreboard.text.general", "interpret": true, "storage": "fz:module"}]
execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"text": "", "color": "green"}, {"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "fz.module.scoreboard.display.activation - "}, {"nbt": "fz.scoreboard.text.activation", "interpret": true, "storage": "fz:module"}]
execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"text": "", "color": "green"}, {"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "fz.module.scoreboard.display.aviating_distance - "}, {"nbt": "fz.scoreboard.text.aviating_distance", "interpret": true, "storage": "fz:module"}]
execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"text": "", "color": "green"}, {"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "fz.module.scoreboard.display.damage_taken - "}, {"nbt": "fz.scoreboard.text.damage_taken", "interpret": true, "storage": "fz:module"}]
execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"text": "", "color": "green"}, {"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "fz.module.scoreboard.display.death_count - "}, {"nbt": "fz.scoreboard.text.death_count", "interpret": true, "storage": "fz:module"}]
execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"text": "", "color": "green"}, {"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "fz.module.scoreboard.display.dig_count - "}, {"nbt": "fz.scoreboard.text.dig_count", "interpret": true, "storage": "fz:module"}]
execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"text": "", "color": "green"}, {"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "fz.module.scoreboard.display.fishing_count - "}, {"nbt": "fz.scoreboard.text.fishing_count", "interpret": true, "storage": "fz:module"}]
execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"text": "", "color": "green"}, {"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "fz.module.scoreboard.display.kill_count - "}, {"nbt": "fz.scoreboard.text.kill_count", "interpret": true, "storage": "fz:module"}]
execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"text": "", "color": "green"}, {"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "fz.module.scoreboard.display.trade_count - "}, {"nbt": "fz.scoreboard.text.trade_count", "interpret": true, "storage": "fz:module"}]
2022-06-23 15:43:39 +08:00
2022-07-03 06:27:45 +08:00
## 初始化计分板显示
2022-06-27 16:06:15 +08:00
### 重置计分板最大id计数
scoreboard players set fz.module.scoreboard.display.highest_id fz.variable.integer -1
2022-06-27 18:51:34 +08:00
### 设置颜色、名称
function #fz:module/scoreboard/display/set_text
### 设置运行时计分板id同时会计算最大id数
2022-07-03 06:27:45 +08:00
function fz:module/scoreboard/display/register_id
### 重置轮播计分板ID
2022-06-27 16:06:15 +08:00
scoreboard players set fz.module.scoreboard.display.current_id fz.variable.integer 0
2022-07-03 06:27:45 +08:00
### 开启轮播循环
2022-06-27 16:06:15 +08:00
function fz:module/scoreboard/display/carousel/loop
## 日志
execute if score fz.logger.level fz.variable.integer matches ..500 run tellraw @a [{"nbt": "fz.level.info", "interpret": true, "storage": "fz:logger"}, {"text": "已加载组件:计分板"}]