▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/TimerCommand
TimerCommand

TimerCommand

A comprehensive command scheduler for Spigot/Paper servers

185
2
Все версииTimerCommand 1.0.3

TimerCommand 1.0.3

Release3 мес. назад

Список изменений

New Features in TimerCommand Plugin

Overview

Three major new features have been added to the TimerCommand plugin:

  1. WEEKLY type - Commands on specific days of the week
  2. Multiple Commands Support - Execute multiple commands for one scheduler
  3. GAME_TIME type - Commands based on in-game time in a world

1. WEEKLY Type - Commands on Specific Days of the Week

Description

Allows you to run a command on specific days of the week at a determined time (e.g., every Friday at 22:59).

Configuration

weekly-example:
  enabled: true
  type: "WEEKLY"
  command: "say This command runs every Monday, Wednesday and Friday at 12:00!"
  time: "12:00"  # Format: HH:mm or HH:mm:ss
  days:
    - "monday"
    - "wednesday"
    - "friday"

Command Format

/tc add WEEKLY <command_name> <day_1-7> <HH:MM:SS> <command>

Day Numbers:

  • 1 = Monday
  • 2 = Tuesday
  • 3 = Wednesday
  • 4 = Thursday
  • 5 = Friday
  • 6 = Saturday
  • 7 = Sunday

Supported Days in config.yml

  • monday (MON)
  • tuesday (TUE)
  • wednesday (WED)
  • thursday (THU)
  • friday (FRI)
  • saturday (SAT)
  • sunday (SUN)

Days are case-insensitive - all of these work:

  • "monday", "MONDAY", "Monday"
  • "mon", "MON", "Mon"

Examples

Example 1: Command every Tuesday at 15:30

tuesday-event:
  enabled: true
  type: "WEEKLY"
  command: "say Tuesday event!"
  time: "15:30"
  days:
    - "tuesday"

Command line: /tc add WEEKLY tuesday_event 2 15:30 say Tuesday event!

Example 2: Commands on weekdays at 09:00

weekday-morning:
  enabled: true
  type: "WEEKLY"
  commands:
    - "say Good morning!"
    - "broadcast Server is ready"
  time: "09:00"
  days:
    - "monday"
    - "tuesday"
    - "wednesday"
    - "thursday"
    - "friday"

Command line: /tc add WEEKLY weekday_morning 1 09:00 say Good morning!

Then manually add days to config.yml.


2. Multiple Commands Support

Description

Instead of running a single command, you can now specify a list of commands that will be executed in sequence.

Configuration

Old way (still works):

single-command:
  enabled: true
  type: "TIME"
  command: "say Single command"
  time: "12:00"

New way (list):

multiple-commands:
  enabled: true
  type: "TIME"
  commands:
    - "say First command"
    - "give @a diamond 1"
    - "broadcast Server announcement"
  time: "12:00"

Notes

  • When using the commands array, the command field is ignored
  • Commands execute in the order specified in the configuration
  • This feature works with ALL scheduler types (TIME, INTERVAL, MONTHLY_DAY, WEEKLY, GAME_TIME)

Examples

Example 1: Daily cleanup with multiple commands

daily-cleanup:
  enabled: true
  type: "TIME"
  commands:
    - "say Starting server cleanup!"
    - "save-all"
    - "broadcast Server will restart in 10 seconds"
  time: "06:00"

Example 2: Weekly bonus on Friday with multiple commands

weekly-bonus:
  enabled: true
  type: "WEEKLY"
  commands:
    - "broadcast Friday bonus!"
    - "give @a gold_ingot 10"
    - "effect give @a speed 3600 1"
  time: "19:00"
  days:
    - "friday"

3. GAME_TIME Type - Commands Based on In-Game Time

Description

Allows you to run a command at a specific in-game time (measured in ticks) in a specific world (e.g., when the sun reaches noon).

In-game time is measured in ticks (0-24000 per day):

  • 0 ticks = Sunrise (start of day)
  • 6000 ticks = Noon (sun at highest point)
  • 12000 ticks = Sunset (afternoon/evening)
  • 18000 ticks = Midnight (darkest, start of night)

Configuration

game-time-example:
  enabled: true
  type: "GAME_TIME"
  command: "say It's noon in-game!"
  world: "world"      # World name
  tick: 6000          # In-game tick (0-24000)

Command Format

/tc add GAME_TIME <command_name> <world_name> <tick_0-24000> <command>

Important Information

  • The command runs only once per day at the specified tick
  • The command runs only in the specified world
  • You must specify an existing world name (e.g., "world", "world_nether", "custom_world")
  • In-game time depends on the doDaylightCycle gamerule - if it's off, the command may not trigger

Examples

Example 1: Noon announcement

noon-event:
  enabled: true
  type: "GAME_TIME"
  command: "say The sun has reached its peak!"
  world: "world"
  tick: 6000

Command line: /tc add GAME_TIME noon_event world 6000 say The sun has reached its peak!

Example 2: Midnight effect with multiple commands

midnight-event:
  enabled: true
  type: "GAME_TIME"
  commands:
    - "say Midnight in-game!"
    - "effect give @a blindness 10"
    - "broadcast The night is darkest!"
  world: "world"
  tick: 18000

Command line: /tc add GAME_TIME midnight_event world 18000 say Midnight in-game!

Example 3: Multiple world events during the day

sunrise:
  enabled: true
  type: "GAME_TIME"
  command: "effect give @a speed 300 1"
  world: "world"
  tick: 0

sunset:
  enabled: true
  type: "GAME_TIME"
  commands:
    - "say The sun is setting"
    - "effect give @a slowness 300 1"
  world: "world"
  tick: 12000

Combined Examples

WEEKLY + Multiple Commands

weekly-with-multiple:
  enabled: true
  type: "WEEKLY"
  commands:
    - "say Friday is here!"
    - "give @a diamond 5"
    - "effect give @a haste 1800 2"
    - "broadcast Weekend event starts!"
  time: "19:00"
  days:
    - "friday"

Command line: /tc add WEEKLY friday_event 5 19:00 say Friday is here!

GAME_TIME + Multiple Commands in Different Worlds

world-noon:
  enabled: true
  type: "GAME_TIME"
  commands:
    - "execute in world run effect give @a speed 600 1"
    - "broadcast It's noon in the main world!"
  world: "world"
  tick: 6000

nether-midnight:
  enabled: true
  type: "GAME_TIME"
  command: "say It's midnight in the Nether"
  world: "world_nether"
  tick: 18000

Backward Compatibility

  • Old configurations will continue to work without any changes
  • New features are completely optional
  • Old command and new commands list cannot be used together in one scheduler
  • The plugin automatically prioritizes commands if both are present

Technical Details

Modified Classes

  1. ScheduledCommand.java

    • Added commands field (list instead of single command)
    • Added daysOfWeek field for WEEKLY type
    • Added gameTimeWorld and gameTimeTarget fields for GAME_TIME type
    • New methods: checkWeeklyExecution(), checkGameTimeExecution()
    • Method execute() now supports multiple commands
  2. CommandScheduler.java

    • Updated loadCommands() method to support:
      • Loading commands array
      • Parsing days array for WEEKLY type
      • Parsing world and tick for GAME_TIME type
    • Added import for java.time.DayOfWeek
    • Updated addCommand() method to save WEEKLY and GAME_TIME parameters
  3. commands.yml

    • Added examples of all three new types
    • Updated documentation with command formats

Troubleshooting

GAME_TIME command didn't trigger

Possible causes:

  • World doesn't exist or name is misspelled
  • doDaylightCycle gamerule is disabled
  • In-game time hasn't reached the specified tick yet

Solutions:

  • Verify world name using /say %server_world_name%
  • Enable daylightCycle: /gamerule doDaylightCycle true
  • Check in-game time: /time

WEEKLY command didn't trigger

Possible causes:

  • Day name is misspelled
  • Timezone in config.yml is incorrect

Solutions:

  • Verify day spelling (e.g., "monday" not "mondy")
  • Check config.yml and set the correct timezone

Questions?

For more information, see the commands.yml file documentation or README.md

Файлы

TimerCommand-1.0.3.jar(104.11 KiB)
Основной
Скачать

Метаданные

Канал релиза

Release

Номер версии

1.0.3

Загрузчики

Bukkit
Paper
Purpur
Spigot

Версии игры

1.21–1.21.11

Загрузок

17

Дата публикации

3 мес. назад

Загрузил

ID версии

Главная