ChronosRewards
ChronosRewards 是一个服务端 Fabric 模组,为多人服务器提供每日登录连续奖励和游玩时长里程碑奖励。所有逻辑均在服务端运行,因此原版客户端玩家无需安装任何客户端模组即可加入服务器并使用奖励菜单。
除 Fabric Loader 外,本模组无任何依赖项。它不需要 Fabric API。
模组功能
当玩家加入服务器时,模组会记录登录时间并在玩家在线期间统计游玩时长。玩家通过聊天指令打开一个箱子样式的奖励菜单。菜单中的每个奖励都会显示其状态:可领取、已领取或仍被锁定。领取奖励会执行为其配置的服务器命令(例如给予物品)。
每日连续奖励基于连续游玩天数解锁。如果玩家在配置的时间窗口内返回,连续天数会增加;如果离开时间超过最大窗口,则重置。
游玩时长奖励基于在服务器上的总游玩时间解锁,以游戏刻(ticks)为单位计量(20 刻等于 1 秒)。
奖励进度和领取状态会自动保存,并在服务器重启后保留。
要求
- 安装了 Fabric Loader 的 Fabric 服务器。
- Java 21 或更高版本用于模组的 1.21.x 版本。
- Java 25 或更高版本用于模组的 26.1.x、26.2.x 和 26.3 版本。
- 无需安装客户端模组。使用原版客户端的玩家即可使用该模组。
下载与你的服务器 Minecraft 版本匹配的模组文件。每个下载页面都列出了支持的 Minecraft 版本。
安装
- 下载适用于你服务器 Minecraft 版本的 ChronosRewards 文件。
- 将
.jar 文件放入服务器的 mods 文件夹中。
- 启动服务器一次。配置文件将在
config/chronos-rewards.json 自动生成。
- 停止服务器,编辑配置文件以定义你的奖励,然后再次启动服务器。
- 玩家在游戏中使用配置的指令(默认为
/rewards)打开菜单。
要在服务器运行时更新配置,请编辑文件并重启服务器或重新加载配置以使新值生效。
指令
| 指令 |
使用者 |
描述 |
/rewards |
任意玩家 |
为执行该指令的玩家打开奖励菜单。指令名称是可配置的;如果你在配置中更改了 command 选项,玩家将使用该名称作为指令。 |
没有仅限管理员使用的指令。配置中定义的奖励命令会在玩家领取奖励时从服务器控制台执行。
配置
配置文件为 config/chronos-rewards.json。在首次启动服务器时,它会使用默认值创建。支持标准 JSON 格式以及带有注释的类似 HOCON 的语法。
主要设置
| 选项 |
类型 |
默认值 |
描述 |
command |
string |
"rewards" |
打开奖励菜单的聊天指令,不包含前导斜杠。 |
autosave_interval_ticks |
integer |
1200 |
自动保存玩家数据的频率,以游戏刻为单位。20 刻等于 1 秒,因此 1200 刻等于 1 分钟。 |
menu.title |
string |
"Chronos Rewards" |
奖励菜单顶部显示的标题。 |
menu.rows |
integer |
3 |
菜单高度。使用 3 表示 27 格的菜单,或使用 6 表示 54 格的菜单。 |
streak.minimum_window_millis |
long |
72000000 |
每日连续奖励领取之间的最小时间间隔,单位为毫秒。默认的 72000000 等于 20 小时,防止在一天内重复领取。 |
streak.maximum_window_millis |
long |
172800000 |
连续奖励重置前的最大时间间隔,单位为毫秒。默认的 172800000 等于 48 小时。在窗口内返回会延长连续天数;超时返回则重置为第 1 天。 |
奖励条目
rewards 数组中的每个对象定义菜单中的一个奖励槽位。
| 选项 |
类型 |
描述 |
id |
string |
奖励的唯一标识符,用于跟踪领取状态。 |
type |
string |
"daily" 表示基于连续的奖励,或 "playtime" 表示基于时间的奖励。 |
slot |
integer |
菜单槽位索引,从 0 开始。对于 3 行菜单,有效范围是 0 到 26;对于 6 行菜单,有效范围是 0 到 53。 |
required_streak |
integer |
所需的连续天数。仅在 type 为 "daily" 时使用。 |
required_ticks |
long |
所需的游玩时间,以游戏刻为单位。仅在 type 为 "playtime" 时使用。72000 刻等于 1 小时。 |
title |
string |
菜单中奖励的显示名称。支持格式化代码。 |
item |
string |
用作菜单图标的物品,例如 "minecraft:emerald"。如果为空或无效,则显示备用图标。除非奖励可领取(此时显示配置的图标),否则图标会根据奖励状态自动变化。 |
lore |
string array |
显示在标题下方的描述行。支持以下占位符。 |
commands |
string array |
领取奖励时执行的服务器命令。支持以下占位符。 |
Lore 占位符
这些占位符可用于 lore 行中:
| 占位符 |
描述 |
{status} |
简短的状态文本:准备领取、已领取或还缺少的内容。 |
{streak} |
当前的每日连续天数。 |
{playtime} |
当前游玩时长,格式化为小时、分钟和秒。 |
{required} |
此奖励所需数量,格式化方式与进度值相同。 |
{remaining} |
解锁此奖励所需的剩余数量。 |
命令占位符
这些占位符可用于 commands 条目中:
| 占位符 |
描述 |
{player} |
领取奖励的玩家名称。 |
{uuid} |
领取奖励的玩家 UUID。 |
{streak} |
玩家的当前每日连续天数。 |
{playtime_ticks} |
玩家的总游玩时间,以游戏刻为单位。 |
示例配置
{
"command": "rewards",
"autosave_interval_ticks": 1200,
"menu": {
"title": "Chronos Rewards",
"rows": 3
},
"streak": {
"minimum_window_millis": 72000000,
"maximum_window_millis": 172800000
},
"rewards": [
{
"id": "daily_1",
"type": "daily",
"slot": 10,
"required_streak": 1,
"title": "Daily Streak: Day 1",
"item": "minecraft:emerald",
"lore": ["Current streak: {streak} day(s)", "{status}"],
"commands": ["give {player} emerald 1"]
},
{
"id": "daily_7",
"type": "daily",
"slot": 12,
"required_streak": 7,
"title": "Daily Streak: Day 7",
"item": "minecraft:diamond",
"lore": ["Current streak: {streak} day(s)", "{status}"],
"commands": ["give {player} diamond 1"]
},
{
"id": "playtime_1h",
"type": "playtime",
"slot": 14,
"required_ticks": 72000,
"title": "Playtime: 1 Hour",
"item": "minecraft:clock",
"lore": ["Played: {playtime}", "{status}"],
"commands": ["give {player} gold_ingot 2"]
}
]
}
菜单外观
空白的菜单槽位会填充中性玻璃板,使菜单看起来完整。每个奖励项都会以粗体显示其标题,颜色与其状态相匹配:可领取为绿色,已领取为金色,锁定为红色。在配置的描述行下方,每个奖励项还会显示分隔线、彩色状态行以及进度行,例如 Progress: 1h 5m / 3h 0m 或 Streak: 2 / 7 days。可领取的奖励项会带有附魔光效,并显示“点击领取”提示。
技术说明
- 1.21.x 版本使用 Yarn 映射,并将玩家数据以 JSON 文件的形式异步存储在虚拟线程上。
- 26.1.x、26.2.x 和 26.3 版本使用 Mojang 官方映射,并通过原版保存的数据系统存储玩家数据。
- 适配 Minecraft 26.2 和 26.3:染色玻璃板等彩色物品被归入颜色集合中,因此菜单背景现在通过新的集合 API 解析灰色玻璃板变体。其他模组行为未发生变化。
- Fabric Loader 会在运行时对模组进行重映射,因此每个构建版本都支持其下载页面上列出的 Minecraft 版本系列。
许可证
Copyright (c) 2026 TOPG-V. All Rights Reserved.
ChronosRewards
ChronosRewards is a server-side Fabric mod that adds daily login streak rewards and playtime milestone rewards for multiplayer servers. Everything runs on the server, so vanilla clients can join and use the reward menu without installing any client-side mods.
There are no dependencies besides Fabric Loader. The mod does not require Fabric API.
What the mod does
When a player joins the server, the mod records the login time and counts playtime while the player is online. Players open a chest-style reward menu with a chat command. Each reward in the menu shows whether it can be claimed, is already claimed, or is still locked. Claiming a reward runs the server commands configured for it, for example giving items.
Daily streak rewards unlock based on consecutive days played. A streak increases when the player returns inside the configured time window and resets when the player stays away longer than the maximum window.
Playtime rewards unlock based on total time played on the server, measured in game ticks (20 ticks equal one second).
Reward progress and claims are saved automatically and persist across server restarts.
Requirements
- A Fabric server with Fabric Loader installed.
- Java 21 or newer for the 1.21.x version of the mod.
- Java 25 or newer for the 26.1.x, 26.2.x, and 26.3 versions of the mod.
- No client-side installation is needed. Players with a vanilla client can use the mod.
Download the mod file that matches your server's Minecraft version. Each download page lists the supported Minecraft versions.
Installation
- Download the ChronosRewards file built for your server's Minecraft version.
- Place the
.jar file into the mods folder of your server.
- Start the server once. The configuration file is generated automatically at
config/chronos-rewards.json.
- Stop the server, edit the configuration file to define your rewards, then start the server again.
- Players open the menu in-game with the configured command (default
/rewards).
To update the configuration while the server is running, edit the file and restart the server or reload configuration so the new values take effect.
Commands
| Command |
Who can use it |
Description |
/rewards |
Any player |
Opens the reward menu for the player running the command. The command name is configurable; if you change the command option in the configuration, players use that name instead. |
There are no operator-only commands. Reward commands defined in the configuration run from the server console when a player claims a reward.
Configuration
The configuration file is config/chronos-rewards.json. It is created with default values on the first server start. Both standard JSON and HOCON-like syntax with comments are accepted.
Main settings
| Option |
Type |
Default |
Description |
command |
string |
"rewards" |
Chat command that opens the reward menu, without the leading slash. |
autosave_interval_ticks |
integer |
1200 |
How often player data is saved automatically, in game ticks. 20 ticks equal one second, so 1200 ticks equal one minute. |
menu.title |
string |
"Chronos Rewards" |
Title shown at the top of the reward menu. |
menu.rows |
integer |
3 |
Menu height. Use 3 for a 27-slot menu or 6 for a 54-slot menu. |
streak.minimum_window_millis |
long |
72000000 |
Minimum time in milliseconds between daily streak claims. The default of 72000000 equals 20 hours and prevents claiming twice in one day. |
streak.maximum_window_millis |
long |
172800000 |
Maximum time in milliseconds before a streak resets. The default of 172800000 equals 48 hours. Returning within the window extends the streak; returning later resets it to day one. |
Reward entries
Each object in the rewards array defines one reward slot in the menu.
| Option |
Type |
Description |
id |
string |
Unique identifier for the reward, used to track claims. |
type |
string |
"daily" for streak-based rewards or "playtime" for time-based rewards. |
slot |
integer |
Menu slot index starting at 0. For a 3-row menu the valid range is 0 to 26; for a 6-row menu it is 0 to 53. |
required_streak |
integer |
Required consecutive days. Only used when type is "daily". |
required_ticks |
long |
Required playtime in game ticks. Only used when type is "playtime". 72000 ticks equal one hour. |
title |
string |
Display name of the reward in the menu. Formatting codes are supported. |
item |
string |
Item used as the menu icon, for example "minecraft:emerald". If empty or invalid, a fallback icon is shown. The icon changes automatically with reward state unless the reward is claimable, in which case the configured item is shown. |
lore |
string array |
Description lines shown under the title. Supports the placeholders listed below. |
commands |
string array |
Server commands executed when the reward is claimed. Supports the placeholders listed below. |
Lore placeholders
These placeholders can be used in lore lines:
| Placeholder |
Description |
{status} |
Short state text: ready to claim, already claimed, or what is still missing. |
{streak} |
Current daily streak in days. |
{playtime} |
Current playtime formatted as hours, minutes, and seconds. |
{required} |
Required amount for this reward, formatted the same way as the progress value. |
{remaining} |
Remaining amount needed to unlock this reward. |
Command placeholders
These placeholders can be used in commands entries:
| Placeholder |
Description |
{player} |
Name of the player claiming the reward. |
{uuid} |
UUID of the player claiming the reward. |
{streak} |
Current daily streak of the player. |
{playtime_ticks} |
Total playtime of the player in game ticks. |
Example configuration
{
"command": "rewards",
"autosave_interval_ticks": 1200,
"menu": {
"title": "Chronos Rewards",
"rows": 3
},
"streak": {
"minimum_window_millis": 72000000,
"maximum_window_millis": 172800000
},
"rewards": [
{
"id": "daily_1",
"type": "daily",
"slot": 10,
"required_streak": 1,
"title": "Daily Streak: Day 1",
"item": "minecraft:emerald",
"lore": ["Current streak: {streak} day(s)", "{status}"],
"commands": ["give {player} emerald 1"]
},
{
"id": "daily_7",
"type": "daily",
"slot": 12,
"required_streak": 7,
"title": "Daily Streak: Day 7",
"item": "minecraft:diamond",
"lore": ["Current streak: {streak} day(s)", "{status}"],
"commands": ["give {player} diamond 1"]
},
{
"id": "playtime_1h",
"type": "playtime",
"slot": 14,
"required_ticks": 72000,
"title": "Playtime: 1 Hour",
"item": "minecraft:clock",
"lore": ["Played: {playtime}", "{status}"],
"commands": ["give {player} gold_ingot 2"]
}
]
}
Menu appearance
Empty menu slots are filled with a neutral glass pane so the menu looks complete. Each reward shows its title in bold with a color matching its state: green for claimable, gold for claimed, red for locked. Below the configured description lines, every reward shows a separator, a colored status line, and a progress line such as Progress: 1h 5m / 3h 0m or Streak: 2 / 7 days. Claimable rewards glow with an enchantment glint and show a "Click to claim" hint.
Technical notes
- The 1.21.x build uses Yarn mappings and stores player data as JSON files written asynchronously on virtual threads.
- The 26.1.x, 26.2.x, and 26.3 builds use official Mojang mappings and store player data with the vanilla saved-data system.
- Adapting to Minecraft 26.2 and 26.3: colored items such as stained glass panes were grouped into color collections, so the menu background now resolves the gray pane variant through the new collection API. No other mod behavior changed.
- Fabric Loader remaps the mod at runtime, so each build supports the Minecraft version family listed on its download page.
License
Copyright (c) 2026 TOPG-V. All Rights Reserved.
评论 0
登录后参与评分
还没有评论,来抢沙发吧