? boti_timer — 全局倒计时/正计时器 (v0.1.0)
一款轻量级的纯原版 Minecraft 计时器数据包,可在操作栏上显示运行中的计时器。
专为需要简单服务器端秒表或倒计时的操作员设计,适用于活动、速通或小游戏。
✨ 功能特性
- ⏱️ 支持正计时或倒计时(可配置)
- ? 可选显示颜色(金色、黄色、紫色、绿色、青色、红色、灰色)
- ? 完全基于函数和计分板构建
- ⚙️ 由操作员控制开始/停止/切换的函数
- ? 实时操作栏显示 (
HH:MM:SS)
- ? 兼容原版、Paper、Fabric 或 Forge 服务器 —— 无需模组
? 安装方法
- 将
boti_timer 文件夹(压缩或未压缩状态均可)放入世界的
datapacks/ 目录中。
- 在游戏中执行
/reload。
⚙️ 初始化
计时器通过命令 /function boti_timer:init 进行初始化(见下文)。这将:
- 创建所需的计分板目标,
- 设置默认值:
- 模式设置为正计时
- 显示颜色设置为黄色
- 计时器可见,并将显示 00:00:00
- 启动每秒重复执行的调度任务。
⚙️ 使用方法
所有模式
计时器通过在聊天窗口或服务器控制台输入命令来控制。原版机制规定,只有服务器操作员才允许使用 /function 命令,因此其他玩家无法启动/暂停等操作计时器。
| 操作 |
命令 |
| 初始化计时器 |
/function boti_timer:init |
| 启动计时器 |
/function boti_timer:start |
| 暂停计时器 |
/function boti_timer:pause |
| 重置计时器 |
/function boti_timer:reset |
| 恢复计时器 |
/function boti_timer:resume |
倒计时模式
倒计时模式提供 4 种预设选项,分别对应 5 分钟、15 分钟、30 分钟和 1 小时。它也可以用于自定义时间段,需以秒为单位指定。
| 操作 |
命令 |
| 初始化计时器 |
/function boti_timer:settings/preset/5m |
| 启动计时器 |
/function boti_timer:settings/preset/15m |
| 暂停计时器 |
/function boti_timer:settings/preset/30m |
| 重置计时器 |
/function boti_timer:settings/preset/1h |
| 恢复计时器 |
/function boti_timer:resume |
使用预设倒计时时,必须手动发出以下命令来启动计时器:/function boti_timer:start
如果需要不同的倒计时时长,可以通过执行命令 /function boti_timer:settings/mode/countdown {secs:nnnn} 来实现,其中 nnnn 为所需的秒数。如果以这种方式启用倒计时计时器,它将立即开始。在以下示例中,倒计时计时器将运行 90 分钟:
/function boti_timer:settings/mode/countdown {secs:5400}
注意:这将立即开始倒计时。
? 操作员控制
| 功能 |
描述 |
/function boti_timer:display/enable |
在操作栏显示计时器 |
/function boti_timer:display/disable |
隐藏计时器显示 |
/function boti_timer:display/toggle |
切换显示/隐藏 |
/function boti_timer:settings/mode/countup |
切换到正计时模式 |
/function boti_timer:settings/mode/countdown {secs:3600} |
切换到倒计时模式并设置秒数(1 小时 = 3600 秒) |
注意: 仅操作员可以运行这些函数。
?️ 自定义
颜色
计时器颜色可以是 7 种颜色之一,默认为黄色。要更改颜色:
| 命令 |
效果 |
| /function boti_timer:settings/color.gold |
将显示颜色设置为 gold |
| /function boti_timer:settings/color.yellow |
将显示颜色设置为 yellow |
| /function boti_timer:settings/color.purple |
将显示颜色设置为 light purple |
| /function boti_timer:settings/color.green |
将显示颜色设置为 green |
| /function boti_timer:settings/color.aqua |
将显示颜色设置为 aqua |
| /function boti_timer:settings/color.red |
将显示颜色设置为 text |
| /function boti_timer:settings/color.gray |
将显示颜色设置为 gray |
© 版权
© 2025 DocBoti —— 根据 MIT 许可证授权。
? boti_timer — Global Countdown / Count-Up Timer (v0.1.0)
A lightweight, fully-vanilla Minecraft timer datapack that displays a running timer on the actionbar.
Designed for operators who need a simple, server-side stopwatch or countdown for events, speedruns, or minigames.
✨ Features
- ⏱️ Count up or down (configurable)
- ? Selectable display colors (gold, yellow, purple, green, aqua, red, gray)
- ? Built entirely with functions and scoreboards
- ⚙️ Operator-controlled start/stop/toggle functions
- ? Real-time actionbar display (
HH:MM:SS)
- ? Works in vanilla, Paper, Fabric, or Forge servers — no mods required
? Installation
- Place the
boti_timer folder (zipped or unzipped) into your world’s
datapacks/ directory.
- Run
/reload in-game.
⚙️ Initialization
The timer is initialised with the command /function boti_timer:init (see below). This will:
- Create required scoreboard objectives,
- Set defaults:
- mode is set to count up
- display colour is set to yellow
- the timer is made visible and will displays 00:00:00
- Start a repeating schedule every second.
⚙️ Usage
All Modes
The timer is controlled by typing commands into the chat or the server console. Vanilla behaviour is, that only server operators are allowed to use the /function command so other players are not able to start/pause etc. the timer.
| Action |
Command |
| initialise the timer |
/function boti_timer:init |
| start the timer |
/function boti_timer:start |
| pause the timer |
/function boti_timer:pause |
| reset the timer |
/function boti_timer:reset |
| resume the timer |
/function boti_timer:resume |
Countdown Mode
The countdown mode comes with 4 presets, for 5 minutes, 15 minutes, 30 minutes and 1 hour respectively. It can also be used with a custom period of time, which needs to be specified in seconds.
| Action |
Command |
| initialise the timer |
/function boti_timer:settings/preset/5m |
| start the timer |
/function boti_timer:settings/preset/15m |
| pause the timer |
/function boti_timer:settings/preset/30m |
| reset the timer |
/function boti_timer:settings/preset/1h |
| resume the timer |
/function boti_timer:resume |
When using the preset countdowns the timer has to be started manually by issuing the following command: /function boti_timer:start
When a different amount of time for the countdown timer is required, this can be done by issuing the comand /function boti_timer:settings/mode/countdown {secs:nnnn} where nnnn is the number of seconds required. If the countdown timer is used this way, it will start immediately. In the following example the countdown timer will run for 90 minutes:
/function boti_timer:settings/mode/countdown {secs:5400}
Note: This will start the countdown immediately.
? Operator Controls
| Function |
Description |
/function boti_timer:display/enable |
Show timer on actionbar |
/function boti_timer:display/disable |
Hide timer display |
/function boti_timer:display/toggle |
Toggle show/hide |
/function boti_timer:settings/mode/countup |
Switch to count-up mode |
/function boti_timer:settings/mode/countdown {secs:3600} |
Switch to countdown mode and set seconds (1 h = 3600) |
Note: Only ops can run these functions.
?️ Customization
Colours
The timer colour can be one of 7 colours and it defaults to yellow. To change the colour:
| Command |
Effect |
| /function boti_timer:settings/color.gold |
set the display colour to gold |
| /function boti_timer:settings/color.yellow |
set the display colour to yellow |
| /function boti_timer:settings/color.purple |
set the display colour to light purple |
| /function boti_timer:settings/color.green |
set the display colour to green |
| /function boti_timer:settings/color.aqua |
set the display colour to aqua |
| /function boti_timer:settings/color.red |
set the display colour to text |
| /function boti_timer:settings/color.gray |
set the display colour to gray |
© Copyright
© 2025 DocBoti — Licensed under the MIT License.
评论 0
登录后参与评分
还没有评论,来抢沙发吧