Skip to content

About

Skript plugin for Paper/Folia Minecraft servers implementing a solo playtime limit system with cross-server presence tracking, matchmaking grace windows, abuse prevention, and real-time bossbar HUD.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Minecraft Solo Timer

A production Skript plugin for Paper/Folia Minecraft servers that limits solo playtime to encourage multiplayer co-op. Players receive 30 minutes of daily solo playtime; when a second player joins, both get unlimited time. Built for a private network with cross-server presence tracking, real-time bossbar HUD, abuse prevention, and a midnight reset system.


How It Works

  • Each player gets 30 minutes of solo playtime per day
  • When 2+ players are online, everyone gets unlimited playtime
  • Solo time counts down in real time with a color-coded bossbar HUD
  • When time runs out, a 60-second matchmaking grace window opens — if a friend joins in time, the session continues
  • At midnight, all timers reset automatically

The system is designed to reward co-op play while giving solo players a meaningful daily time bank.


Features

⏳ Solo Countdown

  • Real-time MM:SS bossbar display
  • Color transitions: green (>15 min) → yellow (>6 min) → red (<6 min)
  • Packet deduplication filter — bossbar commands only fire when values actually change, minimizing server overhead

🎮 Co-op Mode

  • Automatically detects when 2+ players are online (cross-server aware)
  • Switches all players to a blue "Co-op active — infinite playtime!" bossbar
  • Resets grace abuse counters when a legitimate second player joins

🔄 Matchmaking Grace Window

  • 60-second countdown when solo time expires, giving time to find a friend
  • Abuse prevention: capped at 3 grace uses per hour per player
  • Hourly counter resets automatically at the top of each hour
  • Counter resets immediately when a real second player joins (legitimate co-op)

🌙 Midnight Reset

  • Daily timer wipe at 00:00 server time
  • Latch namespace isolation — reset latch stored in {clock::*} namespace so clear {solotime::*} cannot silently destroy it
  • Online players immediately receive a fresh 30-minute credit without needing to relog

📡 Cross-Server Presence Tracking

  • Tracks players across survival and lobby server instances via synced presence arrays
  • Headcount aggregates both servers for accurate solo/co-op detection
  • Falls back to local player count if proxy sync drops

🖥️ HUD & Commands

Command Permission Description
/solotime All players Check your remaining solo time balance
/resettime server.admin Reset your own timer
/resettime <player> server.admin Reset a specific online player's timer
/resettime all server.admin Wipe the full timer database
/resettime info server.admin Dump all online player time balances to console

Technical Details

Architecture

The system runs on a 1-second master tick engine that:

  1. Aggregates cross-server headcount from synced presence arrays
  2. Routes each player to solo countdown or co-op mode
  3. Manages grace window state and abuse detection
  4. Pushes bossbar updates only when values change (dedup filter)

Key Bug Fixes in v2.0

  • Color thresholds corrected to match documented 15min/6min breakpoints (previously used percentage-based thresholds that were ~9min off)
  • Midnight latch moved to {clock::midnight_latch} namespace to prevent clear {solotime::*} from silently destroying it
  • Online players now receive immediate midnight refill without needing to relog
  • Grace bossbar fill accuracy fixed by switching max to 60 during grace countdown
  • /resettime <name> fixed invalid player arg-1 expression that caused parse crashes
  • Solo time floor clamped to 0 to prevent negative display artifacts

Variable Namespaces

Namespace Purpose
{solotime::*} Player time balances and grace state
{clock::*} Midnight and hourly reset latches (isolated from daily wipe)
{network::survival::*} Cross-server survival presence tracking
{network::lobby::*} Cross-server lobby presence tracking

Requirements

  • Paper or Folia 1.17+ (BossBar API required)
  • Skript with SkriptBee/SkBee addon
  • Multi-server setup requires a shared variable backend (e.g. SkriptDB or equivalent) for cross-server presence sync

Installation

  1. Drop solo_timer.sk into your server's plugins/Skript/scripts/ folder
  2. Run /skript reload solo_timer in-game or restart the server
  3. For multi-server setups, configure your shared variable backend to sync {network::*} variables across instances

Configuration

The only user-configurable value is the daily time limit, set at the top of the file:

variables:
    {solotime::default} = 1800   # seconds (default: 30 minutes)

Change 1800 to any value in seconds to adjust the daily solo time bank.


Skills Demonstrated

  • Real-time event-driven system design in Skript
  • State machine architecture (solo / grace / co-op modes)
  • Abuse prevention and edge case handling
  • Cross-server presence tracking and fallback logic
  • Performance optimization via packet deduplication
  • Production debugging and v2.0 regression fixes

License

MIT

About

Skript plugin for Paper/Folia Minecraft servers implementing a solo playtime limit system with cross-server presence tracking, matchmaking grace windows, abuse prevention, and real-time bossbar HUD.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors