CommandScheduler

CommandScheduler

Mod

Schedule any command!

Server ManagementUtility

28 downloads
1 follower
Follow Save

CommandScheduler

This mod is created with efficiency and customization in mind. The mod itself is very lightweight and does not use a lot of memory to run. There is also a lot of customization that can be done through the configs, such as:

  • Add a timer for how often it should run
  • Add a chance for it to run
  • Add a recheck timer for the next time it should run in case the odds don't line up in favor of the command being run due to the chance
  • Toggle whether or not a command should run multiple times or only once. Good for initializations.
  • Add a list of commands that all have a certain weight, which allows you to run a specific command at random in a list

Configs

  "Tasks": {
    "Example task": {
      "commands": [
        {
          "command": "/tell Polqrrrr hello, how are you?",
          "weight": 20
        },
        {
          "command": "/tell Polqrrrr sick mod brother",
          "weight": 40
        }
      ],
      "frequency": 200,
      "chance": 5,
      "recheckInterval": 100,
      "repeatableCommand": true
    }
  }
}

All commands are inside the commands list and have their own weight and command string. To add a new command, simply write a new command and its weight inside some curly brackets!

The frequency allows you to pick how often the task should be run if it is repeatable. Keep in mind, this is measured in ticks, and 20 ticks = 1 second.

The chance allows you to set a chance of the command running in case you want some randomization. If you wish for it to be guaranteed, you can either delete it or just set it to 100.

The recheck interval is how long you should wait before retrying if the command doesn't run due to the chance variable.

You can easily add a new task by copying the configs for the example task and adding it inside the "Tasks" dictionary and changing the things you'd like. This mod is very lightweight so you should be fine adding as many tasks as you want.

If you have any issues, please feel free to contact me on Discord @polarplar


Project members

polarbrbrb

Member

Details

Licensed MIT
Published 2 months ago
Updated 2 months ago