About
CronAnnouncer is a Bukkit/Spigot plugin to allow scheduling broadcast/title messages to all users using a cron expression. I made this since I had the use case to synchronize real-world events (e.g. notifying users about planned backups possibly impacting performance, special events taking place relative to the real world) to minecraft server ticks. For now, this works under the assumption that one second in the real world equals 20 server ticks while also taking into account possible sources of error by detecting and mitigating tick drift/autopausing.
Since this is still a work in progress I cannot guarantee the accuracy of any announcements - please use at your own risk!
Download and Installation
Download the latest jar file from the
releases tab on GitHub, then place the downloaded .jar file in your Spigot/Paper server plugins subdirectory and restart the server.
Configuration
Edit the default config.yml file and uncomment the example.
Once you've made your changes, you will have to reload the plugin or restart the server.
See
http://www.sauronsoftware.it/projects/cron4j/api/it/sauronsoftware/cron4j/SchedulingPattern.html for valid cron patterns.
Example configuration:
Code (YAML):
schedules
:
# A unique key for your message. Used to identify messages for in-game commands like /cronannouncer rm <message-key>.
my-test-message
:
# The content of the message being sent, with color support.
message
:
"&5My colorful message text running every 5 minutes"
# Cron expression defining the interval the message should be sent in
# See http://www.sauronsoftware.it/projects/cron4j/api/it/sauronsoftware/cron4j/SchedulingPattern.html for valid examples
schedule
:
"*/5 * * * *"
# supported types: broadcast/title
# broadcast: chat message
# title: title message (only using the big text for now)
type
: broadcast
Please see the GitHub
README for detailed instructions.
Commands and permissions
Permissions node for all permissions:
Code (Text):
eu.kaesebrot.dev.cronannouncer.*
/cronannouncer list
Lists all scheduled messages.
Arguments: none
Example:
Code (Text):
/cronannouncer list
Permissions node:
Code (Text):
eu.kaesebrot.dev.cronannouncer.list
/cronannouncer add <message-key> <cron-expr> <message-text> <type>
Adds a new message to the config file and reloads the plugin. All arguments may be quoted if spaces are needed.
Arguments:
- message-key: a unique key for the message. Cannont contain spaces.
- cron-expr: A valid cron pattern, has to be in quotes. See configuration section for syntax.
- message-text: The content of the message. Color codes using & and $ are supported. Has to be in quotes if it contains spaces.
- type: The type the message should be. Can be either broadcast or title.
Example:
Code (Text):
/cronannouncer add my-new-message "*/5 * * * *" "&2My message text being displayed every 5 minutes" broadcast
Permissions node:
Code (Text):
eu.kaesebrot.dev.cronannouncer.add
/cronannouncer rm <message-key>
Removes the specified message as identified by the message key from the config file and reloads the plugin.
Arguments:
- message-key: the key of the message to remove (see config.yml reference)
Example:
Code (Text):
/cronannouncer rm my-message-to-be-removed
Permissions node:
Code (Text):
eu.kaesebrot.dev.cronannouncer.remove
/cronannouncer reload
Reloads the config.yml file from disk and queues all scheduled messages.
Arguments: none
Example:
Code (Text):
/cronannouncer reload
Permissions node:
Code (Text):
eu.kaesebrot.dev.cronannouncer.reload