RA-JoinBenefits

Gives new players a welcome benefit when they first join: temporary permissions via LuckPerms or a list of console commands, with expiry reminders and SQLite tracking.

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

PluginRequiredPurpose
LuckPermsYesGrants and removes temporary permission nodes

Storage uses a local SQLite database through HikariCP, so no database setup is needed.


Installation

  1. Place RA-JoinBenefits.jar into your plugins/ folder
  2. Make sure LuckPerms is installed
  3. Restart the server
  4. 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!"
FieldDescription
typePERMISSION_TEMP (timed LuckPerms node) or COMMAND (console commands)
nodePermission node to grant, for PERMISSION_TEMP
duration-hoursHow long the temporary node lasts
commandsConsole commands for COMMAND. %player% is replaced by the player name
grant-message / reminder-message / expired-messageMessages with & color codes. %time_left% is available in the reminder

Commands

CommandDescriptionAccess
/joinbenefits reload (alias /jb)Reload the config and benefitsAdmin
/joinbenefits check <player>Show whether a player counts as newAdmin
/joinbenefits reset <player>Make a player count as new again on their next joinAdmin

Permissions

PermissionDefaultDescription
ra.joinbenefits.adminopUse /joinbenefits

License

Developed by RajaAditya — rajaaditya.my.id