在线时长奖励
Playtime Rewards 是一款可配置的服务器端 Fabric 模组,它将玩家的活动转化为自动化的进度提升。
它会追踪每位玩家的在线时长,导入现有的原版在线时长数据,授予等级,同步 LuckPerms 用户组,发放物品奖励,并提供一套完整的进度 GUI。
该模组专为长期生存多人游戏(SMP)、生存社区、白名单服务器以及注重进度提升的 Fabric 服务器而设计。
无需安装客户端模组。
功能特性
- 追踪玩家在线的每一秒
- 导入现有的原版在线时长
- 通过 UUID 保存进度
- 支持无限数量的可配置等级
- 自动检测等级里程碑
- 广播等级晋升
- 与 LuckPerms 集成
- 创建配置好的 LuckPerms 用户组
- 分配和移除受管理的在线时长用户组
- 保留无关的员工和捐赠者用户组
- 支持可配置的前缀和优先级
- 发放实体物品奖励
- 支持原版和模组物品的 ID
- 防止重复领取奖励
- 重试缺失或失败的奖励
- 安全地处理背包溢出掉落
- 包含手动恢复奖励的功能
- 包含个人档案 GUI
- 包含等级和奖励浏览器
- 包含单独的奖励详情界面
- 包含分页排行榜 GUI
- 包含多种排行榜排序模式
- 包含可配置的等级图标
- 包含可配置的 GUI 图标和文本
- 支持经典颜色和十六进制渐变色
- 包含管理员在线时长命令
- 完全保持在服务器端运行
在线时长追踪
Playtime Rewards 会记录玩家保持在线的每一秒。
在安装后首次加入的玩家,模组会自动检查其原版 Minecraft 在线时长统计并导入。
当在已有服务器上安装该模组时,玩家不会丢失之前的进度。
玩家记录按 UUID 保存,因此用户名更改不会导致重置:
- 总在线时长
- 当前等级
- LuckPerms 同步状态
- 已领取的奖励
- 排行榜排名
等级进阶
等级使用所需的在线时长(秒)进行配置。
当玩家达到里程碑时,模组可以自动执行以下操作:
- 更新其当前等级
- 创建配置好的 LuckPerms 用户组
- 移除旧的受管理在线时长用户组
- 分配新用户组
- 保留无关的用户组
- 应用配置好的前缀
- 发放物品奖励
- 广播等级晋升
- 保存玩家进度
等级数量没有硬性限制。
默认等级
Nomad
所需在线时长:
1 hour
默认展示物品:
minecraft:leather_boots
默认奖励:
默认 LuckPerms 用户组:
nomad
Noble
所需在线时长:
6 hours
默认展示物品:
minecraft:golden_helmet
默认奖励:
默认 LuckPerms 用户组:
noble
Veteran
所需在线时长:
24 hours
默认展示物品:
minecraft:diamond_sword
默认奖励:
- 不死图腾
- 附魔金苹果
- 32 个经验瓶
- 下界合金锻造模板
- 8 颗钻石
默认 LuckPerms 用户组:
veteran
Legend
所需在线时长:
25 days
默认展示物品:
minecraft:nether_star
默认奖励:
- 凋灵锚点 (Withered Claim Anchor)
- 鞘翅
- 下界之星
- 潜影盒
- 64 个经验瓶
默认 LuckPerms 用户组:
legend
默认的凋灵锚点奖励使用以下 ID:
goml:withered_claim_anchor
此物品需要安装 Get Off My Lawn 模组。
它可以替换为任何注册的原版或模组物品。
个人档案 GUI
运行:
/playtime
或:
/playtime me
即可打开个人进度档案。
档案可以显示:
- 玩家名称
- 总在线时长
- 当前等级
- 当前等级图标
- 下一等级
- 进度百分比
- 剩余时间
- 排行榜位置
- 等级和奖励浏览器按钮
- 领取奖励按钮
- 排行榜按钮
原始的基于文本的输出仍可通过以下方式获取:
/playtime text
等级与奖励 GUI
运行:
/playtime ranks
即可打开等级浏览器。
每个配置的等级都会显示为独立的 clickable 物品。
等级列表显示:
- 等级名称
- 所需在线时长
- 锁定或解锁状态
- 可配置的等级图标
- 提示以打开奖励页面的信息
点击某个等级会打开其专属的奖励详情界面。
奖励详情界面
每个等级都有自己独立的奖励页面。
该界面显示:
- 等级的可配置展示物品
- 所有配置的奖励
- 实际奖励物品的图标
- 配置的道具数量
- 已领取或未领取状态
- 返回等级列表的按钮
支持原版和模组奖励。
如果某个等级没有物品奖励,则会显示可配置的空状态物品和消息。
可配置等级图标
每个等级都可以定义自己的视觉物品:
{
"name": "Veteran",
"seconds": 86400,
"displayItem": "minecraft:diamond_sword",
"luckPermsGroup": "veteran",
"luckPermsPrefix": "&4[Veteran]&r ",
"luckPermsPrefixPriority": 300,
"rewards": []
}
展示物品用于以下场景:
它仅用于视觉展示,不作为奖励发放。
可以使用任何注册的物品:
"displayItem": "minecraft:dragon_egg"
或者:
"displayItem": "goml:withered_claim_anchor"
还提供了全局回退选项:
"rankDefaultDisplayItem": "minecraft:book"
无效的物品 ID 会安全回退并生成控制台警告。
排行榜 GUI
运行:
/playtime top
即可打开图形化排行榜。
排行榜显示:
- 总体排名
- 玩家名称
- 总游戏时长
- 当前等级
- 特殊领奖台图标
- 查看者自己的位置
- 页面控制
- 排序控制
- 返回个人资料的按钮
离线玩家仍然可见,因为条目是从保存的玩家记录中生成的。
经典的文本排行榜仍可通过以下方式访问:
/playtime top text
排行榜排序
排行榜可以按以下方式进行排序:
点击排序控件会在可用的排序模式之间循环切换。
排行榜支持多页显示,每页最多包含 45 个玩家条目。
安全只读 GUI
所有 Playtime Rewards 界面均使用受保护的显示槽位。
玩家无法执行以下操作:
- 移除 GUI 显示物品
- 将背包物品放入 GUI 槽位
- 通过双击(shift-click)将物品移入菜单
- 在显示槽位之间拖拽物品
- 对 GUI 物品使用物品转移操作
- 通过点击菜单槽位丢失鼠标光标上的物品
所有个人资料、等级、奖励和排行榜界面均在服务器端保持。
可配置的 GUI 文本
GUI 标题、描述、按钮、图标和状态消息可以在 config.json 中进行自定义。
示例:
"leaderboardGuiTitle": "&6&lPlaytime Leaderboard",
"leaderboardEntryText": "&6#{position} &f{player} &7| &e{playtime} &7| &b{rank}",
"leaderboardYourPositionText": "&eYour position: &6#{position} &7| &e{playtime}",
"rewardDetailGuiTitle": "&b&l{rank} Rewards",
"rewardDetailClaimedText": "&aClaimed",
"rewardDetailUnclaimedText": "&eUnclaimed"
可用的占位符包括:
{player}
{position}
{playtime}
{seconds}
{rank}
{nextRank}
{remaining}
{progress}
{required}
{status}
{rewards}
{claimed}
{totalRewards}
{count}
{item}
{page}
{pages}
{sort}
颜色格式
支持经典的 Minecraft 颜色代码:
&6 金色
&7 灰色
&a 绿色
&b 青色
&c 红色
&d 淡紫色
&e 黄色
&f 白色
格式代码:
&l 粗体
&o 斜体
&n 下划线
&m 删除线
&r 重置
支持十六进制颜色:
&#fbbf24Playtime
可以使用逐字符的十六进制颜色创建渐变效果:
&#fbbf24P&#fabc22l&#fab81fa&#f9b51dy
配置后的标题示例:
"leaderboardGuiTitle": "&#fbbf24&nP&#fabc22&nl&#fab81f&na&#f9b51d&ny&#f9b21a&nt&#f8af18&ni&#f7ab15&nm&#f7a813&ne&r"
添加 &r 会重置当前的格式设置。
LuckPerms 集成
LuckPerms 集成是可选的。
安装后,Playtime Rewards 可以:
- 创建配置的游玩时长组
- 分配正确的组别
- 移除旧的管理型游玩时长组
- 保留无关的组别
- 应用配置的前缀
- 应用可配置的前缀优先级
- 在玩家加入时重新同步
- 在升级时重新同步
- 通过刷新命令重新同步
模组仅管理其自身等级配置中出现的组别。
Staff、donor、builder、booster 以及无关的组别将保持不变。
LuckPerms 前缀需要兼容的聊天、标签页列表或名牌格式化器才能在视觉上显示。
物品奖励
每个等级都可以定义无限数量的物品奖励。
示例:
"rewards": [
{
"item": "minecraft:diamond",
"count": 8
},
{
"item": "minecraft:experience_bottle",
"count": 32
}
]
模组支持服务器上注册的任何物品。
原版物品示例:
minecraft:elytra
模组物品示例:
goml:withered_claim_anchor
当发放奖励时,模组会执行以下操作:
- 查找物品注册表 ID
- 创建物品堆栈
- 将其插入玩家的背包
- 溢出部分在玩家位置掉落
- 将单个奖励标记为已领取
- 保存玩家数据
只有在成功交付后,奖励才会被标记为已领取。
重复保护
每个奖励都独立跟踪。
如果一个物品成功而另一个失败:
- 成功的奖励保持已领取状态
- 成功的奖励不会重复
- 失败的奖励保持未领取状态
- 失败的奖励可以在稍后重试
重启、重连、刷新或重复领取不会导致已成功交付的物品重复。
奖励恢复
玩家可以检查缺失的奖励:
/playtime claim
管理员可以检查其他在线玩家的奖励:
/playtime claim <player>
这在以下情况下非常有用:
- 玩家在达到某个等级后添加了奖励
- 模组物品暂时不可用
- 之前的交付失败
- 服务器重启中断了交付
- 玩家认为他们错过了奖励
玩家命令
/playtime
打开个人资料。
/playtime me
打开个人资料。
/playtime text
显示经典的文本摘要。
/playtime ranks
打开等级和奖励浏览器。
/playtime top
打开排行榜 GUI。
/playtime top text
显示经典的文本排行榜。
/playtime refresh
刷新游玩时长、等级、LuckPerms 同步和保存的进度。
/playtime claim
领取已赚取但未领取的奖励。
管理员命令
/playtime admin set <player> <time>
设置玩家的追踪游玩时长。
/playtime admin add <player> <time>
增加追踪游玩时长。
/playtime admin remove <player> <time>
减少追踪游玩时长。
/playtime admin reset <player>
重置进度和已领取奖励的历史记录。
/playtime admin reload
重新加载配置。
支持的时间格式包括:
3600
6h
30m
2d12h
1d6h30m
配置
配置存储在活动世界文件夹内:
<world>/config/playtime-rewards/config.json
玩家数据存储于:
<world>/config/playtime-rewards/players.tsv
更改配置后,除非使用支持的管理员重载命令,否则请完全重启服务器。
在重大更新之前,请务必备份配置文件和玩家数据。
保存与持久化
玩家数据会在以下情况保存:
- 按照可配置的间隔
- 当玩家断开连接时
- 当玩家升级时
- 当奖励发放时
- 当执行刷新操作时
- 当认领成功时
- 当服务器关闭时
存储的信息包括:
- UUID(唯一标识符)
- 最后已知的用户名
- 总游戏时长
- 当前等级
- 等级历史
- 已领取的奖励
要求
必需项:
Minecraft 26.2
Fabric Loader 0.19.3 或更高版本
Fabric API 0.156.0+26.2 或更高版本
Java 25
可选项:
LuckPerms
Get Off My Lawn
兼容的聊天、标签列表或名牌格式化插件
只有服务器端需要安装 Playtime Rewards。
玩家无需安装该模组。
安装步骤
- 为 Minecraft 26.2 安装 Fabric Loader。
- 安装 Fabric API。
- 将 Playtime Rewards 放入服务器的
mods 文件夹中。
- (可选)安装 LuckPerms。
- (可选)安装 Get Off My Lawn。
- 启动服务器。
- 检查生成的配置文件。
- 编辑配置值后重启服务器。
专为长期运营服务器打造
Playtime Rewards 让活跃玩家获得有意义的进度成长,同时不引入付费优势。
它非常适合用于:
- 生存多人服务器
- 社区 SMP 服务器
- 白名单服务器
- 半原版服务器
- 长期世界
- 基于 Fabric 的模组服务器
- 注重进度成长的社区
奖励忠诚度。
认可专注投入的玩家。
让每一小时都有意义。
Playtime Rewards
Playtime Rewards is a configurable, server-side Fabric mod that turns player activity into automatic progression.
It tracks every player’s online time, imports existing vanilla playtime, awards ranks, synchronizes LuckPerms groups, delivers item rewards, and provides a complete set of progression GUIs.
The mod is designed for long-term SMPs, survival communities, whitelisted servers, and progression-focused Fabric servers.
No client-side mod is required.
Features
- Tracks every second a player is online
- Imports existing vanilla playtime
- Saves progress by UUID
- Supports unlimited configurable ranks
- Automatically detects rank milestones
- Broadcasts rank-ups
- Integrates with LuckPerms
- Creates configured LuckPerms groups
- Assigns and removes managed playtime groups
- Preserves unrelated staff and donor groups
- Supports configurable prefixes and priorities
- Gives physical item rewards
- Supports vanilla and modded item IDs
- Prevents duplicate rewards
- Retries missing or failed rewards
- Drops inventory overflow safely
- Includes manual reward recovery
- Includes a personal profile GUI
- Includes a rank and reward browser
- Includes individual reward-detail screens
- Includes a paginated leaderboard GUI
- Includes multiple leaderboard sorting modes
- Includes configurable rank icons
- Includes configurable GUI icons and text
- Supports classic colors and hex gradients
- Includes administrative playtime commands
- Remains completely server-side
Playtime Tracking
Playtime Rewards records every second a player remains online.
When a player joins for the first time after installation, the mod checks their vanilla Minecraft playtime statistic and imports it automatically.
Players do not lose previous progress when the mod is installed on an established server.
Player records are saved by UUID, so username changes do not reset:
- Total playtime
- Current rank
- LuckPerms synchronization
- Claimed rewards
- Leaderboard position
Rank Progression
Ranks are configured using required playtime in seconds.
When a player reaches a milestone, the mod can automatically:
- Update their current rank
- Create the configured LuckPerms group
- Remove older managed playtime groups
- Assign the new group
- Preserve unrelated groups
- Apply the configured prefix
- Deliver item rewards
- Broadcast the rank-up
- Save the player’s progress
There is no hard limit on the number of ranks.
Default Ranks
Nomad
Required playtime:
1 hour
Default display item:
minecraft:leather_boots
Default rewards:
- 16 Bread
- Iron Pickaxe
- Iron Axe
- Shield
- 16 Torches
Default LuckPerms group:
nomad
Noble
Required playtime:
6 hours
Default display item:
minecraft:golden_helmet
Default rewards:
- 4 Diamonds
- Golden Apple
- 16 Experience Bottles
- Name Tag
- Saddle
Default LuckPerms group:
noble
Veteran
Required playtime:
24 hours
Default display item:
minecraft:diamond_sword
Default rewards:
- Totem of Undying
- Enchanted Golden Apple
- 32 Experience Bottles
- Netherite Upgrade Smithing Template
- 8 Diamonds
Default LuckPerms group:
veteran
Legend
Required playtime:
25 days
Default display item:
minecraft:nether_star
Default rewards:
- Withered Claim Anchor
- Elytra
- Nether Star
- Shulker Box
- 64 Experience Bottles
Default LuckPerms group:
legend
The default Withered Claim Anchor reward uses:
goml:withered_claim_anchor
This item requires Get Off My Lawn to be installed.
It can be replaced with any registered vanilla or modded item.
Personal Profile GUI
Running:
/playtime
or:
/playtime me
opens a personal progression profile.
The profile can display:
- Player name
- Total playtime
- Current rank
- Current rank icon
- Next rank
- Progress percentage
- Time remaining
- Leaderboard position
- Rank and reward browser button
- Claim rewards button
- Leaderboard button
The original text-based output remains available through:
/playtime text
Ranks and Rewards GUI
Running:
/playtime ranks
opens the rank browser.
Each configured rank appears as its own clickable item.
The rank list displays:
- Rank name
- Required playtime
- Locked or unlocked status
- Configurable rank icon
- A prompt to open the reward page
Clicking a rank opens its dedicated reward-detail screen.
Reward Detail Screens
Every rank has its own reward page.
The screen displays:
- The rank’s configurable display item
- Every configured reward
- The real reward item icon
- Configured item quantity
- Claimed or unclaimed status
- A button to return to the rank list
Both vanilla and modded rewards are supported.
If a rank has no item rewards, a configurable empty-state item and message are displayed.
Configurable Rank Icons
Each rank can define its own visual item:
{
"name": "Veteran",
"seconds": 86400,
"displayItem": "minecraft:diamond_sword",
"luckPermsGroup": "veteran",
"luckPermsPrefix": "&4[Veteran]&r ",
"luckPermsPrefixPriority": 300,
"rewards": []
}
The display item is used in:
- The rank browser
- The personal profile
- The reward-detail header
It is visual only and is not given as a reward.
Any registered item can be used:
"displayItem": "minecraft:dragon_egg"
or:
"displayItem": "goml:withered_claim_anchor"
A global fallback is also available:
"rankDefaultDisplayItem": "minecraft:book"
Invalid item IDs fall back safely and generate a console warning.
Leaderboard GUI
Running:
/playtime top
opens the graphical leaderboard.
The leaderboard displays:
- Overall position
- Player name
- Total playtime
- Current rank
- Special podium icons
- The viewer’s own position
- Page controls
- Sorting controls
- A button to return to the profile
Offline players remain visible because entries are generated from saved player records.
The classic text leaderboard remains available through:
/playtime top text
Leaderboard Sorting
The leaderboard can be sorted by:
- Total playtime
- Rank
- Online players first
- Alphabetical order
Clicking the sorting control cycles between available sorting modes.
The leaderboard supports multiple pages with up to 45 player entries per page.
Safe Read-Only GUIs
All Playtime Rewards interfaces use protected display slots.
Players cannot:
- Remove GUI display items
- Place inventory items into GUI slots
- Shift-click items into a menu
- Drag items across display slots
- Use item-transfer actions on GUI items
- Lose cursor items by clicking menu slots
All profile, rank, reward, and leaderboard interfaces remain server-side.
Configurable GUI Text
The GUI title, descriptions, buttons, icons, and status messages can be customized in config.json.
Examples:
"leaderboardGuiTitle": "&6&lPlaytime Leaderboard",
"leaderboardEntryText": "&6#{position} &f{player} &7| &e{playtime} &7| &b{rank}",
"leaderboardYourPositionText": "&eYour position: &6#{position} &7| &e{playtime}",
"rewardDetailGuiTitle": "&b&l{rank} Rewards",
"rewardDetailClaimedText": "&aClaimed",
"rewardDetailUnclaimedText": "&eUnclaimed"
Available placeholders include:
{player}
{position}
{playtime}
{seconds}
{rank}
{nextRank}
{remaining}
{progress}
{required}
{status}
{rewards}
{claimed}
{totalRewards}
{count}
{item}
{page}
{pages}
{sort}
Color Formatting
Classic Minecraft color codes are supported:
&6 Gold
&7 Gray
&a Green
&b Aqua
&c Red
&d Light Purple
&e Yellow
&f White
Formatting codes:
&l Bold
&o Italic
&n Underline
&m Strikethrough
&r Reset
Hex colors are supported:
&#fbbf24Playtime
Per-character hex colors can be used to create gradients:
&#fbbf24P&#fabc22l&#fab81fa&#f9b51dy
Example configured title:
"leaderboardGuiTitle": "&#fbbf24&nP&#fabc22&nl&#fab81f&na&#f9b51d&ny&#f9b21a&nt&#f8af18&ni&#f7ab15&nm&#f7a813&ne&r"
Adding &r resets active formatting.
LuckPerms Integration
LuckPerms integration is optional.
When installed, Playtime Rewards can:
- Create configured playtime groups
- Assign the correct group
- Remove older managed playtime groups
- Preserve unrelated groups
- Apply configured prefixes
- Apply configurable prefix priorities
- Resynchronize players on join
- Resynchronize players on rank-up
- Resynchronize through refresh commands
The mod only manages groups that appear in its own rank configuration.
Staff, donor, builder, booster, and unrelated groups remain untouched.
LuckPerms prefixes require a compatible chat, tab-list, or nametag formatter to appear visually.
Item Rewards
Each rank can define an unlimited number of item rewards.
Example:
"rewards": [
{
"item": "minecraft:diamond",
"count": 8
},
{
"item": "minecraft:experience_bottle",
"count": 32
}
]
The mod supports any item registered on the server.
Vanilla example:
minecraft:elytra
Modded example:
goml:withered_claim_anchor
When a reward is granted, the mod:
- Looks up the item registry ID
- Creates the item stack
- Inserts it into the player’s inventory
- Drops overflow at the player’s position
- Marks the individual reward as claimed
- Saves player data
A reward is only marked as claimed after successful delivery.
Duplicate Protection
Each reward is tracked independently.
If one item succeeds and another fails:
- The successful reward remains claimed
- The successful reward cannot duplicate
- The failed reward remains unclaimed
- The failed reward can be retried later
Restarting, reconnecting, refreshing, or repeatedly claiming does not duplicate successfully delivered items.
Reward Recovery
Players can check for missing rewards with:
/playtime claim
Operators can check another online player with:
/playtime claim <player>
This is useful when:
- Rewards were added after a player passed a rank
- A modded item was temporarily unavailable
- A previous delivery failed
- A server restart interrupted delivery
- A player believes they missed a reward
Player Commands
/playtime
Opens the personal profile.
/playtime me
Opens the personal profile.
/playtime text
Displays the classic text summary.
/playtime ranks
Opens the rank and reward browser.
/playtime top
Opens the leaderboard GUI.
/playtime top text
Displays the classic text leaderboard.
/playtime refresh
Refreshes playtime, rank, LuckPerms synchronization, and saved progression.
/playtime claim
Claims earned but unclaimed rewards.
Administrative Commands
/playtime admin set <player> <time>
Sets a player’s tracked playtime.
/playtime admin add <player> <time>
Adds tracked playtime.
/playtime admin remove <player> <time>
Removes tracked playtime.
/playtime admin reset <player>
Resets progression and claimed reward history.
/playtime admin reload
Reloads the configuration.
Supported time formats include:
3600
6h
30m
2d12h
1d6h30m
Configuration
The configuration is stored inside the active world folder:
<world>/config/playtime-rewards/config.json
Player data is stored in:
<world>/config/playtime-rewards/players.tsv
After changing the configuration, fully restart the server unless using the administrative reload command for supported settings.
Always back up configuration and player data before major updates.
Saving and Persistence
Player data is saved:
- On a configurable interval
- When a player disconnects
- When a player ranks up
- When a reward is delivered
- When a refresh is performed
- When a claim succeeds
- When the server shuts down
Stored information includes:
- UUID
- Last known username
- Total playtime
- Current rank
- Rank history
- Claimed rewards
Requirements
Required:
Minecraft 26.2
Fabric Loader 0.19.3 or newer
Fabric API 0.156.0+26.2 or newer
Java 25
Optional:
LuckPerms
Get Off My Lawn
A compatible chat, tab-list, or nametag formatter
Only the server needs Playtime Rewards.
Players do not need to install the mod.
Installation
- Install Fabric Loader for Minecraft 26.2.
- Install Fabric API.
- Place Playtime Rewards in the server’s
mods folder.
- Optionally install LuckPerms.
- Optionally install Get Off My Lawn.
- Start the server.
- Review the generated configuration.
- Restart after editing configuration values.
Built for Long-Term Servers
Playtime Rewards gives active players meaningful progression without introducing paid advantages.
It is well suited for:
- Survival multiplayer servers
- Community SMPs
- Whitelisted servers
- Semi-vanilla servers
- Long-term worlds
- Modded Fabric servers
- Progression-focused communities
Reward loyalty.
Recognize dedicated players.
Give every hour a purpose.
评论 0
登录后参与评分
还没有评论,来抢沙发吧