RA-Streak
Author: RajaAditya Website: rajaaditya.my.id Version: 1.0.0 API: Paper 1.21.x
Features
Daily Login Streak
- Streak increases by 1 each time a player logs in within a configurable window (default: 24–48 hours since last login)
- Logging in again too soon (within
min-hours) does not affect the streak — prevents relog abuse - Logging in too late (past
max-hours) resets the streak back to 1 - Streak count is colored by tier automatically (
config.yml→streak.colors), fully configurable thresholds and color codes
Duo Streak
- Two players can pair up (
/duo invite,/duo accept) to track a shared streak alongside their individual ones - Duo streak only increments once per day per pair, regardless of which partner logs in first — fixes a double-count issue present in the original Skript version
- If either partner misses the login window, the duo pairing is automatically broken and both players are notified
- Breaking up manually (
/duo breakup) requires confirmation (/duo yes//duo no) within a configurable time window
Custom Command Rewards
- Reach configurable streak milestones (default: 15/30/50/60/70 days) to trigger a list of console commands automatically
- Not limited to money — each milestone can run any number of commands (
eco give,say,broadcast, permission grants, etc.), each fully configurable inconfig.yml %player%and%days%placeholders are available inside every reward command- Reaching the top-tier "legendary" milestone triggers a server-wide broadcast instead of a private message, in addition to running its commands
Flex/Pamer Commands
/streakpamerand/streakpamerduobroadcast the player's (or duo's) current streak to the whole server- Shared cooldown to prevent spam, configurable in
config.yml
Leaderboard
/streaktopshows both the individual streak leaderboard and the duo streak leaderboard side by side- Optional OP-hiding toggle (
/adminstreak op toggle), persisted independently ofconfig.ymlso it survives reloads/restarts - Leaderboard size configurable
Admin Tools
- Set, add to, disable, or enable any player's streak directly (
/adminstreak set|add|disable|enable) - Full server-wide reset (
/adminstreak resetall) /adminstreaksshows a full help menu for every admin sub-command
Fully External Messages
- Zero hardcoded strings — every player-facing message lives in
messages.yml, including prefixes config.ymlonly holds logic/data (timers, reward amounts, color tiers, cooldowns)
PlaceholderAPI Support
- Exposes streak/duo data as placeholders for use in scoreboard/tab plugins
- Identifier:
rastreak
Async by Design
- All database reads/writes run off the main thread (join handling, leaderboard queries, inactive-player cleanup)
- Auto-clear of inactive player data runs on a scheduled async task — no main-thread loop/lag, unlike the original Skript version
Dependencies
| Plugin | Required | Purpose |
|---|---|---|
| Vault | No (softdepend) | Reserved for future use — not required by the reward system, which now runs raw console commands (e.g. eco give) that work with any compatible economy plugin |
| PlaceholderAPI | No (softdepend) | Enables %rastreak_*% placeholders |
No hard dependencies — the plugin runs standalone with SQLite storage; placeholders simply stay inactive if PlaceholderAPI isn't installed. Reward commands work with whatever plugin provides the commands you configure (e.g. EssentialsX for eco give).
Installation
- Place
RA-Streak.jarinto yourplugins/folder - Restart the server
- Edit
config.yml/messages.ymlinplugins/RA-Streak/to your liking - Install an economy plugin (e.g. EssentialsX) if your reward commands include economy commands like
eco give - Restart or reload the server to apply changes
File Structure
plugins/RA-Streak/
├── config.yml # Timers, reward tiers, color thresholds, cooldowns, leaderboard, toggles
├── messages.yml # All plugin messages and prefixes — nothing is hardcoded in the plugin
├── data.db # SQLite database (player streak/duo data + settings)
└── plugin.yml # Plugin metadata
Configuration
config.yml
database:
file: "data.db"
streak:
min-hours: 24
max-hours: 48
inactive-clear-days: 30
auto-clear-interval-hours: 6
auto-clear-batch-size: 50
auto-clear-batch-wait-ticks: 2
# format: hari: [list command yang dijalankan lewat console]
# placeholder yang tersedia di command: %player% (nama player), %days% (hari streak tercapai)
rewards:
15:
- "eco give %player% 50000"
- "say &e%player% &7mencapai streak 15 hari!"
30:
- "eco give %player% 500000"
50:
- "eco give %player% 5000000"
60:
- "eco give %player% 15000000"
70:
- "eco give %player% 50000000"
- "broadcast &6%player% mencapai streak legendaris!"
# Hari yang dianggap "legendary" -> broadcast server + emoji khusus
legendary-day: 70
# Threshold warna berdasarkan jumlah streak (dicek berurutan dari atas)
colors:
- min: 70
max: -1
color: "&6&l"
- min: 50
max: 69
color: "&d"
- min: 30
max: 49
color: "&b"
- min: 15
max: 29
color: "&a"
- min: 1
max: 14
color: "&7"
emoji: "🔥"
duo-emoji: "✨"
pamer:
cooldown-seconds: 60
duo:
breakup-confirm-seconds: 10
leaderboard:
hide-ops: false
top-size: 10
placeholder:
enabled: true
economy:
enabled: true
Config fields:
| Field | Description |
|---|---|
database.file | SQLite file name, stored inside the plugin's data folder |
streak.min-hours | Minimum hours since last login before a new login counts toward the streak |
streak.max-hours | Maximum hours since last login before the streak resets to 1 |
streak.inactive-clear-days | Players with no login for this many days have their data auto-deleted |
streak.auto-clear-interval-hours | How often the inactive-player cleanup task runs |
streak.rewards | Map of day: [commands] — console commands run (with %player%/%days% placeholders) when a player reaches that streak day |
streak.legendary-day | Streak day threshold that triggers a server broadcast instead of a private reward message |
streak.colors | Ordered list of min/max/color tiers used to colorize streak numbers (max: -1 means "and above") |
streak.emoji / streak.duo-emoji | Emoji appended after individual / duo streak numbers |
pamer.cooldown-seconds | Cooldown between uses of /streakpamer and /streakpamerduo |
duo.breakup-confirm-seconds | Time window a player has to confirm a /duo breakup with /duo yes |
leaderboard.hide-ops | Default value for hiding OP players from /streaktop (actual runtime value is toggled and persisted via /adminstreak op toggle) |
leaderboard.top-size | Number of entries shown per leaderboard (individual and duo) |
placeholder.enabled | Master toggle for registering the PlaceholderAPI expansion |
economy.enabled | Master toggle for giving Vault money rewards |
messages.yml
All player-facing text, fully translatable. Supports & color codes. Nothing is hardcoded in the plugin — if a key is missing here, the plugin logs a placeholder warning string instead of failing.
prefix:
streak: "&6&lꜱᴛʀᴇᴀᴋ &8•&f"
duo: "&d&lᴅᴜᴏ &8•&f"
streak:
gained: "%prefix% &e%player% &7ʙᴀʀᴜ ꜱᴀᴊᴀ ᴍᴇɴᴄᴀᴘᴀɪ ꜱᴛʀᴇᴀᴋ %streak_color%"
reset: "%prefix% &cꜱᴛʀᴇᴀᴋ ʟᴀᴍᴀ ᴋᴀᴍᴜ ᴅɪʜᴀᴘᴜꜱ..."
reward-claimed: "%prefix% &bꜱᴛʀᴇᴀᴋ %days% ʜᴀʀɪ! &7ʙᴏɴᴜꜱ ʙᴇʀʜᴀꜱɪʟ ᴅɪᴋʟᴀɪᴍ."
reward-broadcast-legendary: "%prefix% &6&lʟᴇɢᴇɴᴅᴀʀʏ! ..."
duo:
invite-sent: "%prefix_duo% &7ᴜɴᴅᴀɴɢᴀɴ ᴅᴜᴏ ᴛᴇʀᴋɪʀɪᴍ ᴋᴇ &e%partner%&7."
# ...full duo.* messages: invite, accept, breakup, streak-up notifications
pamer:
broadcast-header: "&6&lꜱᴛʀᴇᴀᴋ ꜰʟᴇx &8• &e%player%"
# ...pamer.* broadcast messages
leaderboard:
top-header: "&e&lᴛᴏᴘ ꜱᴛʀᴇᴀᴋ &8• &7ɢʟᴏʙᴀʟ"
# ...leaderboard.* entry formats
admin:
help-header: "&6&lꜱᴛʀᴇᴀᴋ ᴀᴅᴍɪɴ &8• &7ᴄᴏᴍᴍᴀɴᴅꜱ"
# ...full admin.* help text and feedback messages
Common placeholders available in messages:
| Placeholder | Available In |
|---|---|
%prefix% / %prefix_duo% | Every message (auto-injected, no need to reference prefix.* manually) |
%player% | Streak gain, duo invite/accept, reward broadcasts |
%partner% | All duo.* messages |
%streak_color% | streak.gained, streakme.individu, leaderboard entries, pamer broadcasts |
%duo_color% | streakme.duo-line, duo leaderboard entries, duo pamer broadcasts |
%days% | streak.reward-claimed, streak.reward-broadcast-legendary |
%rank% | leaderboard.entry* |
%max-hours% | streak.reset, duo.broken-you-bolos (auto-injected from config) |
Commands
| Command | Description | Access |
|---|---|---|
/streak | Show an overview of all streak-related commands | Everyone |
/streakme | Show your own streak status (individual + duo) | Player |
/streaktop | Show the individual and duo streak leaderboards | Everyone |
/streakpamer | Broadcast your current individual streak to the server | Player |
/streakpamerduo | Broadcast your current duo streak to the server | Player |
/duo invite <player> | Send a duo streak invite | Player |
/duo accept | Accept the most recent pending invite | Player |
/duo breakup | Request to break up your current duo pairing | Player |
/duo yes | Confirm a pending breakup request | Player |
/duo no | Cancel a pending breakup request | Player |
/adminstreak set <player> <angka> | Set a player's streak to an exact number | Admin |
/adminstreak add <player> <angka> | Add to a player's streak | Admin |
/adminstreak disable <player> | Disable streak tracking for a player (resets to 0) | Admin |
/adminstreak enable <player> | Re-enable streak tracking for a player (resets to 1) | Admin |
/adminstreak op toggle | Toggle hiding OP players from /streaktop | Admin |
/adminstreak resetall | Wipe all streak/duo data server-wide | Admin |
/adminstreaks | Show the full admin command help menu | Admin |
Permissions
| Permission | Default | Description |
|---|---|---|
rastreak.admin | op | Access to all /adminstreak and /adminstreaks sub-commands |
rastreak.use | true | Access to player-facing /streak* and /duo commands |
Streak Logic
On every player join, the plugin compares the time since their last recorded login against streak.min-hours and streak.max-hours:
| Time since last login | Result |
|---|---|
< min-hours | No change — relogging the same day doesn't count twice |
>= min-hours and < max-hours | Streak +1, reward check runs, duo streak check runs |
>= max-hours | Streak resets to 1, any duo pairing is broken for both players |
All of this runs asynchronously on join — the database read/write never blocks the main thread, and only the final chat/broadcast messages are dispatched back to the main thread.
Duo Streak Logic
Two players share a duo streak counter separate from their individual streaks. To prevent the double-count bug present in the original Skript version — where the duo counter could increment twice in a day (once per partner's login) — each player's data stores a duo_last_credit_day marker (an epoch-day value).
When a player's individual streak continues:
- The plugin checks whether their duo partner also logged in within the
max-hourswindow - If yes, and today's epoch-day hasn't already been credited for this pair, both partners' duo counters increment together and both get their
duo_last_credit_dayupdated - If the partner hasn't logged in within the window yet, the player is told to wait for their partner instead
If either partner misses their own login window (>= max-hours), the pairing is broken automatically for both players, and each is notified — the active player sees a "you bolos" message, the other (if online) sees a "your partner bolos" message.
Manually breaking up (/duo breakup) requires the initiating player to confirm with /duo yes within duo.breakup-confirm-seconds; letting the window expire or sending /duo no cancels the request.
PlaceholderAPI
Requires PlaceholderAPI to be installed. Identifier: rastreak.
| Placeholder | Description |
|---|---|
%rastreak_count% | Player's individual streak count (plain number) |
%rastreak_count_color% | Individual streak count, colorized per streak.colors tier |
%rastreak_duo_count% | Player's duo streak count (plain number) |
%rastreak_duo_color% | Duo streak count, colorized per streak.colors tier |
%rastreak_duo_partner% | Name of the player's duo partner, or - if none |
%rastreak_disabled% | true/false — whether streak tracking is disabled for this player |
Data Storage
Player streak data (individual count, duo pairing/count, last login, disabled flag, pamer cooldown) is stored in a local SQLite database (data.db), accessed through a HikariCP connection pool. A separate streak_settings table stores runtime-toggleable settings — currently just the OP-hiding leaderboard flag — so they persist independently of config.yml across reloads and restarts.
An async task runs every streak.auto-clear-interval-hours to remove data for players inactive longer than streak.inactive-clear-days, keeping the database from growing indefinitely on large servers.
License
Developed by RajaAditya — rajaaditya.my.id