Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
VGSources
Blog

How to Create a Scheduled Task on a Minecraft Server

A practical guide to scheduling Minecraft server work with plugin timers, datapacks, calendar expressions, and external schedulers—plus tick math, restart behavior, thread safety, and troubleshooting.
Length9 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The correct way to schedule work depends on where that work belongs. Use the Paper, Spigot, or Bukkit scheduler for plugin code; a datapack’s /schedule function command for vanilla Java Edition commands; a cron-capable plugin or host scheduler for calendar times; and an operating-system or hosting-panel scheduler for backups, restarts, monitoring, and jobs that must run while Minecraft is stopped.

Before choosing a method, decide whether the delay should follow Minecraft simulation ticks or real-world clock time. That distinction determines accuracy, behavior during lag, and whether the task can run when the server process is offline.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the scheduling layer first

A scheduled action should be owned by the system that can execute it reliably. A plugin task can call the Bukkit API, a datapack can run commands inside a loaded world, and an external scheduler can start or control the server process itself.

Method Best for Timing basis Calendar expressions Execution and visibility
Paper/Spigot/Bukkit scheduler Plugin code, events, broadcasts, world changes Server ticks Not built in Java code, task handles, and server/plugin logs
Datapack function scheduling Vanilla commands in Java Edition Ticks, seconds, or days Not built in Command output, function behavior, and /schedule clear
Recurring datapack tick/load tags Every-tick checks and initialization Ticks or world load Not built in Function files and game commands
Scheduling plugin with cron features Calendar times, command sequences, conditions, placeholders Plugin-defined clock semantics Yes, when supported by that plugin Often includes GUI editing, logs, and cancellation; verify current documentation
Host panel or operating-system scheduler Backups, restarts, monitoring, and jobs while Minecraft is stopped Wall clock and host timezone Usually, depending on the scheduler Service logs, operating-system logs, and provider controls

The table describes architectural roles rather than a guarantee for every product or host. Confirm the Minecraft version, server software, plugin release, permissions, and timezone rules before deploying.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

Ticks, seconds, and real time are different

How Minecraft ticks convert to seconds

Paper defines one server tick as one execution of the game loop. At a healthy 20 TPS (ticks per second), there are 20 ticks per second, or one tick every 50 milliseconds. Therefore, 20 ticks is approximately one second, 100 ticks approximately five seconds, and 1,200 ticks approximately one minute.

These are simulation-time conversions, not independent stopwatch guarantees. A delay of 100 ticks can take about 10 seconds when the server is processing at 10 TPS. The task waits for 100 game-loop iterations, so lag stretches the wall-clock interval.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When to use wall-clock time

Use an explicitly timezone-aware external scheduler, or a plugin that documents its timezone semantics, when a task must run at a real-world time such as 03:00 every day. Do not assume that the host’s timezone is UTC, local time, or the timezone shown in your own control panel. Daylight-saving changes and container or provider settings can alter the observed time.

Choose a timing contract

  • Use ticks when the action is part of gameplay and should advance with simulation, such as a repeating effect or in-game announcement.
  • Use a wall clock when the requirement is a calendar event, such as a nightly backup or a scheduled restart.
  • Use an external scheduler when the action must happen while the Minecraft process is stopped.

Create a repeating task in a Paper, Spigot, or Bukkit plugin

Plugin code should use the server scheduler rather than creating an unmanaged thread. A repeating task needs the plugin instance, the code to execute, an initial delay in ticks, and a period in ticks.

Basic repeating task

// inside a JavaPlugin subclass
long initialDelay = 20L * 5; // five seconds at 20 TPS
long period = 20L * 60;       // approximately one minute at 20 TPS
BukkitTask task = getServer().getScheduler().runTaskTimer(
    this,
    () -> getServer().broadcast(Component.text("Scheduled message")),
    initialDelay,
    period
);

The first value delays the first execution by about five seconds at 20 TPS. The second value requests another execution every approximately 60 seconds at 20 TPS. Keep the returned BukkitTask if the task may need to be cancelled later.

One-shot work

For work that should run once after a delay, use runTaskLater instead of runTaskTimer. A one-shot task is preferable to a repeating task that tries to remember whether it has already completed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

Cancel a task deliberately

Store the task handle in a field and cancel it during plugin shutdown, when an administrative command disables the feature, or when a self-canceling condition is reached. A BukkitRunnable or a scheduler callback that receives its own BukkitTask can cancel itself after a required number of executions. Cancellation should also remove any state that would cause the task to be scheduled twice after a reload.

Keep Bukkit API work on the main thread

World mutations and most Bukkit API access belong on the server’s main thread. Do not call Thread.sleep() there: sleeping pauses the game loop and can make the entire server appear frozen.

Use an asynchronous task for blocking network, file, or database I/O. Once the result is available, schedule a short synchronous task to perform the Bukkit API operation. Large portions of the Bukkit API are not safe from an asynchronous thread, so do not pass world, entity, inventory, or server mutations directly into an async callback without checking the API’s thread-safety requirements.

Separate I/O from game-state changes

  1. Run the timer on the scheduler.
  2. Read or write external data asynchronously if the operation can block.
  3. Validate the returned data without touching mutable game state.
  4. Hand the final world or entity update back to a synchronous scheduler task.
  5. Cancel or log the task when the I/O operation fails instead of silently retrying forever.

Schedule on plugin enable and account for restarts

A repeating task created in memory is tied to that server process. On enable, schedule the task again or restore its next-run state from persistent storage if the exact schedule matters. Decide whether a restart should skip missed executions, run one immediately, or resume from a stored timestamp. Test reloads and restarts for duplicate tasks; a common failure is registering a second timer while the first one remains active.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Folia and alternative server models

If the server uses Folia or another regionized execution model, do not assume that a Bukkit or Paper scheduling call has identical behavior. A scheduling plugin may advertise Folia compatibility, but that is a vendor claim to verify against its current documentation, supported Minecraft version, and API requirements. Test entity and region operations on a staging server before production use.

Schedule vanilla commands with a Java datapack

A datapack is appropriate when the action can be expressed as Minecraft commands and does not require plugin APIs. Put the command sequence in a function file, then schedule that function from the server.

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

Create the function

For a namespace named example, create a function file at:

data/example/function/announce.mcfunction

Place one command per line in that file. The namespace and path are case-sensitive and must match the loaded datapack.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Schedule a one-time execution

schedule function example:announce 5m replace

This schedules example:announce after five minutes. The Java Edition reference supports tick, seconds, and day units; use the unit that makes the intent clear and check the syntax for the target Minecraft version.

Choose replace or append

  • replace replaces an existing pending schedule for that function. It is useful for a single next execution, cooldown reset, or debounce behavior.
  • append adds another pending execution. Use it only when multiple future runs are intentional, because repeated commands can otherwise create a growing queue.

Cancel a pending function

schedule clear example:announce

The clear command cancels the pending schedule for that function. Include cancellation in administrative controls and test it after repeated scheduling so an old execution cannot surprise players later.

Run recurring datapack logic

For work that must be checked every tick, add the function to the minecraft:tick function tag. For initialization after a world load or reload, use the minecraft:load function tag. A tick-tagged function runs every game tick, so keep its command set small and gate expensive checks with scoreboards, predicates, or suitable conditions.

Datapack scheduling is still tied to server simulation. It does not turn a command into a wall-clock service, and it cannot perform work while the server process is offline. Store any state that must survive a restart and make the load function restore or reschedule it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Use a cron-capable scheduling plugin for calendar commands

When administrators need expressions such as “every weekday at 18:30,” a maintained scheduling plugin can provide cron syntax, command sequences, GUI editing, execution logs, conditions, and placeholders. The cited plugin listing claims Paper, Spigot, and Folia compatibility, but compatibility and timezone behavior must be confirmed in the plugin’s current documentation before production use.

Validate a scheduling plugin before relying on it

  • Confirm the exact Minecraft and server-software versions supported by the current release.
  • Check whether expressions use the server timezone, a configured timezone, or UTC.
  • Verify whether schedules persist across restart and whether missed runs are skipped or replayed.
  • Review permissions for creating, editing, triggering, and canceling jobs.
  • Check where execution failures and command output are logged.
  • Inspect source or release history when available, and keep a backup and rollback plan.
  • Test region-sensitive operations separately on Folia rather than relying only on a compatibility label.

For a simple repeating command, a datapack or small plugin is often easier to audit. A cron-oriented plugin becomes valuable when non-developers need to edit many calendar jobs, apply conditions, or inspect execution history.

Run jobs outside Minecraft

Backups, watchdogs, restarts, monitoring, and maintenance that must run while Minecraft is stopped belong to the hosting panel or operating-system scheduler. The implementation depends on Linux or Windows, the service manager, account permissions, the provider’s control panel, and timezone configuration, so there is no single command that is safe to copy to every host.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Design an external job safely

  1. Identify the service account and the command or panel action that starts, stops, or backs up the server.
  2. Set the scheduler’s timezone explicitly and document daylight-saving behavior.
  3. Acquire a lock or otherwise prevent two copies of the job from running simultaneously.
  4. Write success and failure output to a known log location.
  5. Make backups atomic enough that a partial archive cannot replace the last known-good backup.
  6. Test the job with a staging server and verify recovery, not just creation.

An external scheduler cannot safely manipulate in-game state unless the server exposes a controlled interface, such as a console command path or administrative connection. Keep credentials out of command lines and restrict the service account’s permissions.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Why scheduled tasks run late or more than once

The interval is late during lag

If a tick-based task is late, inspect the server’s TPS and workload. The scheduler counts game-loop progress, so a 100-tick delay at 10 TPS takes about 10 seconds rather than five. Reduce expensive synchronous work, move blocking I/O off the main thread, and avoid putting heavy command scans in an every-tick datapack function.

The task runs twice after a reload

Look for a new timer being registered on every enable without canceling the previous one. Keep one task handle, cancel it during disable, and ensure the enable path has a single scheduling point. For datapacks, use replace when only one pending execution should exist.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

The task disappears after a restart

Determine whether the schedule was held only in memory. Plugin code should recreate it on enable, while datapacks should initialize or restore state through minecraft:load. If the job is operational rather than gameplay-related, move it to an external scheduler that is independent of the Minecraft process.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The job runs at the wrong clock time

Compare the configured timezone with the host, container, panel, and plugin settings. A cron expression without an explicit timezone is not enough evidence that the job will run at the administrator’s local time. Document the chosen zone and test a near-future run before relying on it for maintenance.

An asynchronous task causes errors or corrupted state

Return to the split between I/O and game state: perform only blocking external work asynchronously, then schedule Bukkit or world mutations synchronously. If the plugin’s API documentation marks a call as unsafe, treat it as main-thread-only.

Production checklist

  • Identify Java versus Bedrock Edition and Paper, Spigot, Bukkit, Folia, or another server platform.
  • Choose simulation ticks or a timezone-aware wall clock.
  • Convert intervals to ticks only when lag-dependent timing is acceptable.
  • Keep synchronous tasks short and move blocking I/O to asynchronous work.
  • Define restart behavior: reschedule, persist state, skip missed runs, or delegate externally.
  • Test cancellation, duplicate scheduling, permissions, command failure, and lag.
  • Record where logs appear and how an administrator can prove a job ran.
  • Back up configuration and world data before installing or changing scheduling plugins.

Frequently Asked Questions

Can a Minecraft scheduled task run while the server is offline?

No. Plugin schedulers and datapack functions require the Minecraft process to be running. Use a host-panel or operating-system scheduler for work that must occur while the server is stopped.

Should I use ticks or cron for a task every five minutes?

Use ticks when a gameplay interval may stretch with lag; use an explicitly timezone-aware wall-clock scheduler when five real-world minutes matters.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I stop a datapack task I scheduled earlier?

Run schedule clear namespace:path with the exact function namespace and path used when scheduling it.

Why is Thread.sleep() dangerous in a plugin?

Sleeping on the main server thread pauses the game loop. Use the scheduler for delays and reserve asynchronous execution for blocking I/O that does not touch unsafe Bukkit APIs.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.