PlayingWithTime - Permissions based on Player game time icon

PlayingWithTime - Permissions based on Player game time -----

Set player permissions based on time played in-game



Set and change permissions for your players based on how long they've been playing on your server.
  • Greet your players differently based on how long they've been playing
  • Use with a currency plugin to give your users different amounts of rewards based on their time in-game
  • Give your players a one-time gift once they've reached a play-time milestone!
  • and more...
** This plugin is highly configurable! **

Installation
To install this plugin:
  • Copy the jar file into your server/plugins directory
  • Restart your server
  • Default configuration is in server/plugins/PlayingWithTime folder
  • You can then change the config files and add the group configs (see below).
  • To restart the plugin based on the new configuration, use the /playingwithtime reload command.
For all commands, see commands below.

Commands
Available commands can be run in-game or in the console.
  • /playingwithtime help - Provides a list of available commands and their purpose.
  • /playingwithtime reload - Reloads the plugin with the given config. Use this when you change any of the config files.
  • /playingwithtime process - Runs the process for all online users, instead of waiting for users to login. Use this to enact all operations on online users - either on first time install, or when you change the config files. If this isn't run, users will only be impacted the next time they rejoin the server.
Permissions
The plugin has several permissions that can be tweaked:
  • playingwithtime.ignore - Anyone with this permission will be ignored from the process of calculating time played on the server.
  • playingwithtime.cmd.process - This permission allows a user to run the /playingwithtime process command.
  • playingwithtime.cmd.reload - This permission allows a user to run the /playingwithtime reload command.
Support

This plugin is free and open source.
  • If you like this plugin, please rate it <3
  • If you use this plugin in your server, please let me know so I can add it to the proud users list!
  • If there are any issues or feature requests, please use the github issues interface
  • If you like this plugin, consider buying me some coffee :)
Configuration
The config files have inline comments that are self-explanatory to help admins set up the process the way they please. Below is an example for ways to perform a one-time action based on time played, and a recurring action based on time played.

Admins can configure as many definitions as they wish to set permissions for their players based on time played on the server.

The main config.yml file defines the general commands run to change permissions and groups (by default, it uses the LuckPerm commands, but this can be changed). The definition of each group is in a separate config based on its name.

config.yml
Code (YAML):
  # A list of commands representing the way to add a permission and/or group to a user.
# The defaults utilize LuckPerm commands, but you can change this to utilize any other
# method of updating group or permission to your users.
# Make sure you use the correct placeholders:
# Available placeholders for commands:
# - %playername% Player name
# - %timeingame% Player's time in game, in minutes.
# - %typename% for the name of the permission or group that you want your user to be added to.
# You can add multiple commands -- all will be run when the process decides to add a group or permission
# to a player.
# NOTE: If no commands are specified, the system will NOT be able to add groups or permissions!
commands_definition_add
:
  # Raw command to add permission to a user. The added permissions are defined in each config in the 'add' section.
  add_permission
: 'lp user %playername% permission set %typename% true'
    # Raw command to add a group to a user. The added groups are defined in each config in the 'add' section.
  add_group
: 'lp user %playername% parent set %typename%'
# A list of ranks to use. Each rank name will be defined in a separate file that's defined
# in a separate config, determining the in-game time to activate and the resulting permission
# or groups to be added to the player when that time is met.
definitions
:
 -  'recurring'
  -  'onetime'
PlayingWithTime_rank_recurring.yml
This config file is used because the main config.yml has 'recurring' definition.

This will execute every time a player joins with the minimum requirements. It can be used to greet a player, and use different greetings based on time played on the server!

Code (YAML):
  # Add the user to groups/permissions.
# Can be one or multiple in either group or permissions lists.
# If none provided, no permission/group action will be done.
add
:
  groups
:
  permissions
:
# Time played in-game, in minutes. When the player's time in-game is equal-to or higher-than
# this number, the rest of the operation dictated in this definition will be
# further evaluated.
time
: '10'
# Custom command that will run if the user matches time played and prerequisites
# But will **not** run if the user already has the group/perms under "add" groups
# Watch out; if nothing is provided under 'add' group above, this command will run
# every time the user logs in if their time played is above the value.
# Available placeholders for commands:
# - %playername% Player name
# - %timeingame% Player's time in game, in minutes.
custom_commands
:
# Send a message following the processing of this definition. The message can be
# sent to the user specifically, or to the entire chat as a broadcast.
# If more than one message is provided per each (user and broadcast) in the list,
# only one will be chosen, at random. However, both messages for to_user and to_everyone
# will be assessed independently, which means admins can send both a random message to the
# user directly *and* a random broadcast message to the entire chat.
# Available placeholders for messages:
# - %playername% Player name
# - %timeingame% Player's time in game, in minutes.
send_message
:
  # Send message directly to the user. No one else will see it.
    # If more than one message is provided, a random one is chosen each time
    # a user triggers the definition process.
  to_user
:
   -  'Welcome to the server - the longer you play, the better things get!'
  to_everyone
:
PlayingWithTime_rank_ontime.yml
This config file is used because the main config.yml has 'onetime' definition.
This action will execute once per player, because the next time it tries to execute, the player already has a group permission that the config ignores.

Code (YAML):
add:
  groups
:
  permissions
:
   -  'foo.basic'
time
: '0'
custom_commands
:
send_message
:
  to_user
:
   -  'Welcome to the server, player! you will only see this message once.'
musthave
:
  groups
:
  permissions
:
canthave
:
  groups
:
# Because this says the player can't have the 'foo.basic' permission, this
# will only run once; the first time it runs, it will send the message to the
# user and then add the foo.basic permission -- which means the next
# time the user joins, the operation will be skipped, because the user
# can't have that permission
  permissions
:
   -  'foo.basic'
Resource Information
Author:
----------
Total Downloads: 56
First Release: Jun 6, 2021
Last Update: Jun 6, 2021
Category: ---------------
All-Time Rating:
0 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings