PlayerTimeLimit

模组

· 作者 tntnetta

为你的 Minecraft 服务器上的玩家设置每日游戏时间限制。

0 本站下载 0 关注 更新于 11 个月前

需要前置:fabric-permissions-api、LuckPerms

最新 1.0.2 · 1.20.1 · Fabric

一键开服(送7天)

?? 英文

⏱ Player Time Limit Mod

PlayerTimeLimit 是一款适用于 Fabric 的服务端(非客户端)Minecraft 模组,允许为每位玩家设置每日游戏时长限制、每日重置这些限制,并通过命令和公共 API 管理这些时间。非常适合教育类、家庭类或受控游玩的服务器。


? 功能

  • ⏳ 可配置的玩家每日游戏时长。
  • ⚠️ 时间耗尽前可自定义警告提示。
  • ? 时间结束后自动踢出玩家。
  • ? 基于时区的每日自动重置。
  • ? 可自定义的消息内容。
  • ? 支持离线玩家(UUID 已缓存)。
  • ? 屏幕上的信息性 BossBar。
  • ? 支持 LuckPerms 权限系统。
  • ? 供其他模组使用的公共 API。

? 命令

所有命令均以 /plt 开头,并支持玩家自动补全,即使玩家处于离线状态也有效。

/plt check <player>            # 显示剩余时间
/plt info <player>             # 显示详细状态(时间、暂停、耗尽)
/plt addtime <player> <sec>    # 为玩家增加时间
/plt removetime <player> <sec> # 从玩家处移除时间
/plt resettime <player>        # 将时间重置为默认值
/plt pause <player>            # 暂停玩家的时间计数器
/plt resume <player>           # 恢复时间计数器
/plt reload                    # 重新加载 YAML 配置文件

? LuckPerms 权限

每个命令都需要特定的权限,你可以使用如 LuckPerms 之类的插件来分配这些权限:

权限 描述
PLimitTime.admin 访问所有命令
PLimitTime.command.check 查看玩家时间和信息
PLimitTime.command.addtime 为玩家添加时间
PLimitTime.command.removetime 从玩家处移除时间
PLimitTime.command.resettime 重置玩家时间
PLimitTime.command.pause 暂停玩家的时间
PLimitTime.command.resume 恢复玩家的时间
PLimitTime.command.reload 重新加载 YAML 配置

✅ 如果未安装 LuckPerms,则将使用 hasPermissionLevel(4)(即 OP 权限)作为回退方案。


⚙️ YAML 配置

路径:config/playertimelimit.yaml

defaultTime: 18000

reset:
  time: "00:00"
  timezone: "America/Mexico_City"

warnings:
  - time: 1800
    message: "⏳ 30 minutes of playtime remaining."
  - time: 900
    message: "⏳ 15 minutes of playtime remaining."
  - time: 120
    message: "⏳ 2 minutes left. Get ready!"

messages:
  timeExpired: " Your playtime for today has ended. See you tomorrow!"
  welcome: " Welcome! You have %time% seconds of playtime remaining."
  timeAdded: " %time% seconds have been added to your session!"
  timeRemoved: " %time% seconds were removed from your session."
  timeReset: " Your time has been reset to %time% seconds."
  paused: "✨ Your time is currently paused."

bossbar:
  message: "Remaining time: %hours%h %minutes%m %seconds%s"
  color: WHITE

? 公共 API

该模组提供了一个公共 API 以与其他模组集成。你可以从以下位置访问它:

import com.TNTStudios.playertimelimit.Playertimelimit;
import com.TNTStudios.playertimelimit.api.PlayerTimeLimitAPI;

PlayerTimeLimitAPI api = Playertimelimit.getAPI();

// Usage examples
api.addTime(uuid, 300);      // Add 5 minutes
api.removeTime(uuid, 60);    // Subtract 1 minute
api.pause(uuid);             // Pause time
api.resume(uuid);            // Resume time
int time = api.getTime(uuid); // Get remaining time
boolean paused = api.isPaused(uuid); // Check if paused

? 依赖要求


? 许可证

PlayerTimeLimit 是一个保留所有权利(All Rights Reserved)的项目。
允许在私人、教育和私人服务器上使用该模组。
未经事先授权,禁止公开再分发或修改。


? 致谢

由 TNTStudios 开发。
旨在促进 Minecraft 社区中负责任、可控且可定制的游戏体验。

感谢使用 PlayerTimeLimit! ?


?? 西班牙语

⏱ Player Time Limit Mod

PlayerTimeLimit es un mod para servidores (no cliente) de Minecraft en Fabric que permite establecer límites de tiempo de juego por jugador, reiniciarlos diariamente, y gestionar estos tiempos a través de comandos y una API pública. Ideal para servidores educativos, familiares o con control de juego.


? Características

  • ⏳ Tiempo diario configurable por jugador.
  • ⚠️ Advertencias configurables previas al fin del tiempo.
  • ? Kick automático al terminar el tiempo.
  • ? Reinicio diario automático basado en zona horaria.
  • ? Mensajes personalizados configurables.
  • ? Soporte para jugadores offline (UUID cacheado).
  • ? BossBar informativo en pantalla.
  • ? Soporte de permisos con LuckPerms.
  • ? API pública para otros mods.

? Comandos

Todos los comandos comienzan con /plt y soportan autocompletado de jugadores, incluso si están offline.

/plt check <jugador>            # Muestra el tiempo restante
/plt info <jugador>             # Muestra estado detallado (tiempo, pausado, agotado)
/plt addtime <jugador> <seg>    # Agrega tiempo al jugador
/plt removetime <jugador> <seg> # Remueve tiempo del jugador
/plt resettime <jugador>        # Reinicia el tiempo al valor por defecto
/plt pausar <jugador>           # Pausa el contador de tiempo del jugador
/plt reanudar <jugador>         # Reanuda el contador de tiempo
/plt reload                     # Recarga el archivo de configuración YAML

? Permisos LuckPerms

Cada comando requiere permisos específicos que puedes asignar con plugins como LuckPerms:

Permiso Descripción
PLimitTime.admin Acceso a todos los comandos
PLimitTime.command.check Ver tiempo e info de jugadores
PLimitTime.command.addtime Añadir tiempo a jugadores
PLimitTime.command.removetime Quitar tiempo a jugadores
PLimitTime.command.resettime Reiniciar tiempo de jugadores
PLimitTime.command.pausar Pausar el tiempo de un jugador
PLimitTime.command.reanudar Reanudar el tiempo de un jugador
PLimitTime.command.reload Recargar configuración YAML

✅ Si LuckPerms no está disponible, se utilizará hasPermissionLevel(4) (operador) como mecanismo de fallback.


⚙️ Configuración YAML

Ruta: config/playertimelimit.yaml

tiempoPorDefecto: 18000

reinicio:
  hora: "00:00"
  zonaHoraria: "America/Mexico_City"

advertencias:
  - tiempo: 1800
    mensaje: "⏳ Quedan 30 minutos de juego."
  - tiempo: 900
    mensaje: "⏳ Quedan 15 minutos de juego."
  - tiempo: 120
    mensaje: "⏳ Quedan 2 minutos. ¡Prepárate!"

mensajes:
  tiempoAgotado: " Tu tiempo de juego para hoy ha terminado. ¡Nos vemos mañana!"
  bienvenida: " ¡Bienvenido! Tienes %tiempo% segundos restantes de juego."
  tiempoAgregado: " ¡%tiempo% segundos han sido añadidos a tu sesión!"
  tiempoRemovido: " %tiempo% segundos fueron removidos de tu sesión."
  tiempoRestablecido: " Tu tiempo ha sido restablecido a %tiempo% segundos."
  pausado: "✨ Tu tiempo está actualmente pausado."

bossbar:
  message: "Tiempo restante: %horas%h %minutos%m %segundos%s"
  color: WHITE

? API Pública

El mod expone una API pública para integraciones con otros mods. Puedes acceder a ella desde:

import com.TNTStudios.playertimelimit.Playertimelimit;
import com.TNTStudios.playertimelimit.api.PlayerTimeLimitAPI;

PlayerTimeLimitAPI api = Playertimelimit.getAPI();

// Ejemplos de uso
api.addTime(uuid, 300);      // Añadir 5 minutos
api.removeTime(uuid, 60);    // Restar 1 minuto
api.pause(uuid);             // Pausar tiempo
api.resume(uuid);            // Reanudar tiempo
int tiempo = api.getTime(uuid); // Consultar tiempo restante
boolean pausado = api.isPaused(uuid); // Verificar si está pausado

? Requisitos


? Licencia

PlayerTimeLimit es un proyecto con licencia All Rights Reserved.
Su uso está permitido para servidores privados, educativos y personales.
No se permite redistribuir ni modificar públicamente sin autorización previa.


? Créditos

Desarrollado por TNTStudios.
Diseñado con el propósito de fomentar un juego responsable, controlado y personalizable en comunidades de Minecraft.

¡Gracias por usar PlayerTimeLimit! ?

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源