RA-JoinBenefits
Author: RajaAditya Website: rajaaditya.my.id Version: 1.0.0 API: Paper 1.20+
Features
Welcome Benefits for New Players
- Define any number of named benefits in
config.yml, each one can be enabled or disabled on its own - Temporary permission benefits grant a permission node through LuckPerms for a set number of hours
- Command benefits run console commands once (starter kit, money, items)
- A message is shown when a benefit is granted
Expiry Reminders
- Players are reminded when a temporary benefit has less than a configurable time left
- A message is sent when the benefit ends
- A background task scans periodically to send reminders and clean up expired entries
Reliable "New Player" Detection
- A player counts as new based on this plugin's own database, not Minecraft's
hasPlayedBefore() - Because of this, every existing player is treated as new once after the plugin is first installed, which works well as a launch promo
- After that, only genuinely new players receive benefits
Admin Tools
- Reload the config without a restart
- Check whether a player has already received their benefits
- Reset a player so they count as new again on their next join
Dependencies
| Plugin | Required | Purpose |
|---|---|---|
| LuckPerms | Yes | Grants and removes temporary permission nodes |
Storage uses a local SQLite database through HikariCP, so no database setup is needed.
Installation
- Place
RA-JoinBenefits.jarinto yourplugins/folder - Make sure LuckPerms is installed
- Restart the server
- Edit
plugins/RA-JoinBenefits/config.yml, then run/joinbenefits reload
File Structure
text
1
plugins/RA-JoinBenefits/
├── config.yml # Settings and the list of benefits
└── (SQLite file) # Known players and active temporary benefits
Configuration
config.yml
yaml
1
settings:
reminder-before-expiry-minutes: 60 # send a reminder when this much time is left
check-interval-seconds: 60 # how often reminders and cleanup run
broadcast-on-grant: false # true = broadcast, false = message only the player
benefits:
ai-trial:
enabled: true
type: PERMISSION_TEMP
node: "raaichat.use"
duration-hours: 24
grant-message: "&aYour 24-hour AI trial is now active&a! Type &f/ai &ato get started."
reminder-message: "&eYour AI trial expires in &f%time_left%&e."
expired-message: "&cYour AI trial has ended. Upgrade in the store for permanent access!"
# starter-kit:
# enabled: true
# type: COMMAND
# commands:
# - "give %player% diamond 5"
# - "eco give %player% 500"
# grant-message: "&aStarter kit given, have fun!"
| Field | Description |
|---|---|
type | PERMISSION_TEMP (timed LuckPerms node) or COMMAND (console commands) |
node | Permission node to grant, for PERMISSION_TEMP |
duration-hours | How long the temporary node lasts |
commands | Console commands for COMMAND. %player% is replaced by the player name |
grant-message / reminder-message / expired-message | Messages with & color codes. %time_left% is available in the reminder |
Commands
| Command | Description | Access |
|---|---|---|
/joinbenefits reload (alias /jb) | Reload the config and benefits | Admin |
/joinbenefits check <player> | Show whether a player counts as new | Admin |
/joinbenefits reset <player> | Make a player count as new again on their next join | Admin |
Permissions
| Permission | Default | Description |
|---|---|---|
ra.joinbenefits.admin | op | Use /joinbenefits |
License
Developed by RajaAditya — rajaaditya.my.id