Command Scheduler
Schedule commands to run at specific points.
Setup
- Add Command Scheduler jar into your plugins folder.
- Restart your server.
- Edit commands.yml to your liking.
- Type /commandscheduler reload.
Commands
- /commandscheduler help: Show the help message.
- /commandscheduler reload: Reload the plugin.
- /commandscheduler execute: Execute a specific configured command immediately.
- /commandscheduler time: Check the current server time. Useful for configuring a cron.
Permissions
- commandscheduler.reload: Allows the use of the reload command.
- commandscheduler.execute: Allows the use of the execute command.
- commandscheduler.time: Allows the use of the time command.
Scheduled Commands
# This example will say hello to all players every 30 seconds.
hello-players:
commands:
- 'message: Hello, {player}!'
triggers:
interval-ticks: 600
# This example will broadcast random help messages every 10 minutes.
random-help-message:
commands:
- 'broadcast: Remember to read the rules!'
- 'broadcast: Need help? Ask a staff member!'
- 'broadcast: Check out our website for more info!'
only-run-one-random-command: true
triggers:
interval-ticks: 12000
# This example will give all players $100 every 5 minutes.
five-minute-cash:
commands:
- 'console-for-each-player: eco give {player} 100'
triggers:
cron: 0 0 */5 * * * * # second, minute, hour, day of month, month, day of week, year
# This example will broadcast a message one minute after the server starts.
one-minute-message:
commands:
- 'broadcast: The server has been running for one minute!'
triggers:
ticks-from-server-start: 1200
# This example will make all players run /spawn every hour on the hour.
hourly-spawn:
commands:
- 'for-each-player: spawn'
triggers:
cron: 0 0 0 * * * * # second, minute, hour, day of month, month, day of week, year
# This example will stop the server at midnight every day.
midnight-shutdown:
commands:
- 'console: stop'
triggers:
cron: 0 0 0 0 * * * # second, minute, hour, day of month, month, day of week, year
Settings
- commands: Commands to run when the command configuration is executed. Syntax: <commandType>:<command>. See Command Types.
- triggers: Control when the command configuration is executed.
- execute-conditions: Conditions checked when the command configuration is triggered. If conditions are not met, the commands will not execute.
- player-conditions: Conditions checked for individual players when commands are executed. If conditions are not met for a player, commands will not run for that player when using console-for-each-player and for-each-player command types.
- only-run-one-random-command: Only runs one random command instead of all commands when executed.
Command Types
- console: Executes the command as the console.
- console-for-each-player: Executes the command as the console for each online player, replacing {player} with the player's name.
- for-each-player: Executes the command as each online player, replacing {player} with the player's name.
- broadcast: Broadcasts a message to all online players.
- message: Sends a message to all online players, replacing {player} with the player's name.
Triggers
- interval-ticks: The number of ticks between each execution of the command configuration.
- cron: A cron expression to control specific points that the command configuration will execute down to the tick. Syntax: <second> <minute> <hour> <dayOfMonth> <month> <dayOfWeek> <year>.
- ticks-from-server-start: The number of ticks from server start when the command should execute. Can have multiple values comma separated.
Execute Conditions
- min-players-online: Commands will only execute if this many players are online.
- min-players-who-meet-conditions: Commands will only execute if this many players meet conditions.
- max-players-who-meet-conditions: Commands will only execute if fewer than this many players meet conditions.
- all-players-meet-conditions: Commands will only execute if all players meet conditions.
Player Conditions
- worlds: Commands will only execute if the player is in one of these worlds.
- environments: Commands will only execute if the player is in one of these environments.
- biomes: Commands will only execute if the player is in one of these biomes.
- gamemodes: Commands will only execute if the player is in one of these game modes.
- has-permissions: Commands will only execute if the player has all of these permissions.
- missing-permissions: Commands will not execute if the player has any of these permissions.
- min-x: Commands will only execute if the player is above this x value.
- min-y: Commands will only execute if the player is above this y value.
- min-z: Commands will only execute if the player is above this z value.
- max-x: Commands will only execute if the player is below this x value.
- max-y: Commands will only execute if the player is below this y value.
- max-z: Commands will only execute if the player is below this z value.
- in-water: If true, commands will only execute if the player is in water. If false, commands will only execute if the player is not in water. If this setting is not present, commands will execute regardless.
- sneaking: If true, commands will only execute if the player is sneaking. If false, commands will only execute if the player is not sneaking. If this setting is not provided, then commands will execute regardless.
- blocking: If true, commands will only execute if the player is blocking. If false, commands will only execute if the player is not blocking. If this setting is not provided, then commands will execute regardless.
- climbing: If true, commands will only execute if the player is climbing. If false, commands will only execute if the player is not climbing. If this setting is not provided, then commands will execute regardless.
- gliding: If true, commands will only execute if the player is gliding. If false, commands will only execute if the player is not gliding. If this setting is not provided, then commands will execute regardless.
- glowing: If true, commands will only execute if the player is glowing. If false, commands will only execute if the player is not glowing. If this setting is not provided, then commands will execute regardless.
- riptiding: If true, commands will only execute if the player is riptiding. If false, commands will only execute if the player is not riptiding. If this setting is not provided, then commands will execute regardless.
- in-vehicle: If true, commands will only execute if the player is in a vehicle. If false, commands will only execute if the player is not in a vehicle. If this setting is not provided, then commands will execute regardless.
- sprinting: If true, commands will only execute if the player is sprinting. If false, commands will only execute if the player is not sprinting. If this setting is not provided, then commands will execute regardless.
- flying: If true, commands will only execute if the player is flying. If false, commands will only execute if the player is not flying. If this setting is not provided, then commands will execute regardless.
- on-fire: If true, commands will only execute if the player is on fire. If false, commands will only execute if the player is not on fire. If this setting is not provided, then commands will execute regardless.
- frozen: If true, commands will only execute if the player is frozen. If false, commands will only execute if the player is not frozen. If this setting is not provided, then commands will execute regardless.