服务器使用量
未统计
服务玩家数
未统计
下载量
13,403
插件详细介绍
PlayerTime 是一款小巧实用的插件,允许你查询玩家在服务器上的累计在线时长。虽然同类插件不少,但本插件的独特之处在于支持查询离线玩家的时长,并提供了多种集成方式,让数据统计更加灵活全面。
核心特性
- 支持离线玩家:即使玩家不在线,也能查询其历史累计游戏时间。
- 支持 MySQL:可将数据存储于 MySQL 数据库,便于集中管理。
- 支持 BungeeCord:所有子服务器连接至同一 MySQL 数据库即可实现跨服时长统计。
- 支持 PlaceholderAPI:提供丰富的占位符,方便在其他插件或菜单中显示。
- 内置 Top 10 GUI:通过直观的图形界面查看在线时长排行榜。
插件的工作原理很简单:当玩家登录时开始记录,在其退出时,本次在线时长会被累加并保存。所有数据都会被持久化存储,因此可以随时查询任意玩家的总时长。
配置说明
以下为配置文件 (config.yml) 的核心内容示例:
# PlayerTime ${project.version}
# 请勿修改此行
config-version: 2
plugin-prefix: "[&dPlayer&eTime&f]"
# 数据库类型,支持 YML 或 MySQL
database:
type: YML
# 使用 MySQL 时请取消注释以下部分
# host: "localhost"
# port: 3306
# username: "root"
# password: "password"
# database: "playertime"
# pool-size: 10
# 查询时间时显示的格式
format: "&a{name} has been playing for {days} days, {hours} hours, {minutes} minutes, {seconds} seconds"
# 排行榜类型,可选 "gui" 或 "text"
leaderboard-type: "gui"
# GUI 排行榜设置
gui:
title: "Top Ten PlayerTimes"
time-format: "{days} days, {hours} hours, {minutes} minutes, {seconds} seconds"
item:
name: "{player}'s time"
material: "PAPER"
lore:
- "Ranked #{slot}"
- "Time Played: {format}"
# 文本排行榜设置
text-top:
title: "&7------------------------"
footer: "&7------------------------"
content: "&7{place}. &a{name} &f{time}"
# 提示消息
messages:
incorrect-usage: "Too many arguments. Use /ptcheck or /ptcheck <name>"
never-played-before: "Data for this player was not found. Never played?"
no-playtime-data: "There was no saved playtime data for this player"
config-reload: "PlayerTime config has been reloaded!"命令与权限
可用命令
/ptcheck [玩家名]- 查询自己或指定玩家的在线时长。/pttop- 打开在线时长排行榜(Top 10)。/ptreload- 重载插件配置文件。
对应权限
playertime.check- 允许使用/ptcheck查询自己的时长。playertime.others- 允许查询其他玩家的时长(用于/ptcheck <玩家名>)。playertime.top- 允许使用/pttop命令。playertime.reload- 允许使用/ptreload命令重载配置。
PlaceholderAPI 占位符
若安装了 PlaceholderAPI,可使用以下占位符:
%playertime_time%- 格式化的总时长(如:2 days, 3 hours)。%playertime_time_seconds%- 总秒数。%playertime_time_minutes%- 总分钟数。%playertime_time_hours%- 总小时数。
测试支持版本
版本分布
基本信息
插件名称
PlayerTime (Offline Player / MySQL / BungeeCord / PlaceholderAPI Supported)
作者
Glare
平台
Bukkit / Spigot
支持版本
1.9 - 1.16
点赞数
3
最近版本
暂无数据
-