fz-survival-datapack/data/fz/functions/module/scoreboard/load.mcfunction
2022-06-27 18:51:34 +08:00

32 lines
4.1 KiB
Mcfunction
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 调用者:#fz:module/scoreboard/load
## 异常检测
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"}]
## 初始化计分板
### 重置计分板最大id计数
scoreboard players set fz.module.scoreboard.display.highest_id fz.variable.integer -1
### 设置颜色、名称
function #fz:module/scoreboard/display/set_text
### 设置运行时计分板id同时会计算最大id数
function #fz:module/scoreboard/display/register_id
## 重置轮播计分板ID
scoreboard players set fz.module.scoreboard.display.current_id fz.variable.integer 0
## 开启轮播循环
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": "已加载组件:计分板"}]