A Minecraft plugin that enables admins to run groups of commands for players every set amount of minutes.
Report Bug
·
Request Feature
TimelyActions is a Minecraft (Spigot) plugin that enables admins to run groups of commands for players every set minutes.
Users will be eligible for the commands once per defined time period, no matter how many times they rejoin or stay in the server. Optionally base interval actions on user permissions to give different gifts to your users based on their ranks or privileges on the server.
Some use case examples include:
- Give your players a gift every 24h
- Send your users reminder messages every 60 minutes
To get this plugin working on your server, follow the normal plugin installation method, outlined below.
- Spigot server v1.16.3 and up
- Minumum Java version: 8
- Download the
jar
file of the latest release. - Place the
jar
file in your server's/plugins
directory - You have two options:
** If you want to create your own config, create the folder
/plugins/TimelyActions
and addconfig.yml
file into it. Follow the instructions below on how to create your initial config file with your own interval. ** Restart your server. The plugin will work out of the box with the sample action in an automatically createdconfig.yml
file. You can then edit this file.
To change and add your own intervals, you should edit the configuration file /plugins/TimelyActions/config.yml
The configuration file allows for several options:
Default: false
Enabling this config option will output more information into the console. Use this if you want to verify your plugin operates properly, or if you run into issues, enable this to be able to help with the bug fix issues.
This is a list (map) of intervals with key names. The named keys will be used for outputs into the console, and in the commands checking whether players have had the interval run for them.
An example interval definition:
iron_every_5:
every_minutes: 5
message_to_user: "Every 5 minutes, you get an &7&liron ingot&r, %player%!"
permission: ''
commands:
- give %player% minecraft:iron_ingot
The name iron_every_5
is defined by the admin when writing the definition, and can be any legal yaml key. General guidance is to use lowercase letters with underscores instead of spaces. If you use anything else, please make sure to validate your yaml file to make sure the key is valid. This name will appear in logs and when looking to check player's status within the interval.
every_minute (default: 60)
Defines the interval time, in minutes, where players will be eligible to have the actions defined run for them.
For example, if the value is 60, the system will run the given commands for players at minimum every 60 minutes from the last time the command ran for that player, no matter how many times the player has joined or disconnected.
message_to_user
Defines the message that is sent to the user when the interval runs for the user. This is a yaml string, and it respects minecraft chat color codes.
permission
Defines the permission needed for the player to have this interval apply, regardless of time. If defined, this interval will only apply to users who hold this permissions.
For example, this can be used to give different periodic gifts for your users based on their rank on the server.
commands
This defines a list of commands to be run on each relevant user when the interval applies to them. You can define whoever many commands you want, but all commands are run in the console, so they all must be console-commands (do not use in-game commands, and do not use /
).
You can use placeholders in the command text:
%player%
will be replaced by the player's name. Example:"You're getting an iron ingot every hour, %player%!"
An example configuration below results in all players being eligible to receive a gift of iron ingot every hour. The command will run for them if they are online, or whenever they join.
log_everything: false
intervals:
iron_every_hour:
every_minutes: 60
message_to_user: "Every hour on the server, you get an &7&liron ingot&r, %player%!"
permission: ''
commands:
- give %player% minecraft:iron_ingot
Please note: Interval commands do not stack; if a user misses several hours on the server, they will receive one iron ingot when they join back again, and then wait for the next another hour. They will not get the missing ingots they would have gotten if they were online for the hours they've missed. This allows admins to make sure the intervals are awarding players every x minutes, rather than stack to give multiple gifts for players who are not on the server.
Once the plugin is running, admins have access to several in-game and console actions to manage the intervals and players.
The plugin's main command /timelyactions [action]
where the actions are:
/timelyactions reload
Reloads configuration without the need to restart the server.
/timelyactions stop
/timelyactions start
Stops or starts the timed action interval. If the stop action is used, the system will completetly stop checking-for and running commands for intervals, even if players are eligible.
/timelyactions player [player name]
Checks the status of a player with intervals that the system is aware of. The command will return the latest 5 intervals with their names and times where the user has recieved the commands specified.
This can help admins find specific command output in the logs, or make sure players have received certain gifts or actions and when.
/timelyactions playerinterval [player name] [interval name]
Similarly to the player
command this checks the status of a player with a specific interval that the system is aware of. The command will return the latest 5 results for the given interval and user with the times this has run.
This can help admins find specific command output in the logs, or make sure players have received certain gifts or actions and when.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the GPLv3 License. See LICENSE
for more information.
Written and developed by mooeypoo (c) 2020.
Submit a bug report or hit me up on twitter at @mooeypoo
Pull requests are welcome! 😍