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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

The right way to schedule work depends on where that work belongs. Use the Paper/Spigot/Bukkit scheduler for plugin code, a Java Edition datapack for vanilla commands, a calendar-aware plugin for in-game cron-style times, and your host or operating-system scheduler for backups, restarts, monitoring, or jobs that must run while Minecraft is stopped.

Choose between simulation time (ticks) and wall-clock time (minutes and hours). A tick-based task follows the server’s actual simulation speed; it is not a guaranteed real-time alarm. A wall-clock task needs an explicitly timezone-aware scheduler. The sections below show how to build, cancel, test, and troubleshoot each type without blocking the server or losing schedules after a restart.

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

Choose the scheduling layer first

Before writing a command or Java method, identify the process that owns the work. This prevents common mistakes such as trying to use a datapack to restart a stopped server or running database code on Minecraft’s main thread.

What must happen Best fit Time model What happens on restart
Change worlds, entities, inventories, or run plugin logic while the server is online Paper/Spigot/Bukkit scheduler Ticks Tasks normally disappear; create them again during plugin enable
Run vanilla commands without installing a plugin Java Edition datapack functions and /schedule Ticks, seconds, or days Pending schedules are not a substitute for persistent application state; initialize or reschedule on load as needed
Run at a calendar time, such as 03:00 every day A plugin that documents cron and timezone behavior, or an external scheduler Wall clock Depends on the scheduler; verify persistence and missed-run behavior
Back up files, restart a service, monitor availability, or run while Minecraft is stopped Hosting control panel or operating-system/service scheduler Wall clock Designed to operate independently of the game process

If the requirement says “every five minutes while the world is running,” ticks may be sufficient. If it says “at 18:00 UTC,” do not silently convert that to ticks; use a scheduler with an explicit timezone.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Ticks, seconds, and why a task can run late

Minecraft advances through discrete simulation steps. Paper describes one execution of that loop as a tick: a healthy server targets 20 ticks per second, or approximately one tick every 50 milliseconds. Therefore, 20 ticks is approximately one second and 100 ticks is approximately five seconds when the server maintains 20 TPS.

A tick delay is tied to simulation progress, not an independent stopwatch. If the server is running at 10 TPS, a nominal 100-tick delay can take about 10 seconds of real time. Heavy world generation, entity counts, redstone, garbage collection, or a long-running plugin can all reduce TPS. A repeating task can consequently execute less often in wall-clock time while still honoring its tick period.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Use ticks when the action should advance with the game simulation, such as a five-second warning before a round starts.
  • Use a timezone-aware wall-clock scheduler when a missed or late real-world deadline matters.
  • Measure the server’s actual TPS and keep each synchronous callback short; scheduling does not make expensive work cheap.

Schedule plugin code with Paper, Spigot, or Bukkit

Prerequisites and lifecycle

You need a Java plugin that extends JavaPlugin, is loaded by the server, and creates its tasks from a lifecycle method such as onEnable(). Keep a reference to a returned task when you may need to cancel it. Tasks created by a plugin should be cancelled when that plugin is disabled, and any external resources should be closed in onDisable().

Run something once after a delay

Use runTaskLater for one-shot work. The delay is expressed in ticks:

long delay = 20L * 30; // approximately 30 seconds at 20 TPS
getServer().getScheduler().runTaskLater(this, () -> {
    getServer().broadcastMessage("The event starts now");
}, delay);

The callback runs on the server’s main thread, where ordinary world and Bukkit API operations are safe. It will still be late in wall-clock time if the server cannot process ticks promptly.

Run a repeating task

Use runTaskTimer with an initial delay and a period. The following starts after approximately five seconds and repeats about once per minute at 20 TPS:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
long initialDelay = 20L * 5;
long period = 20L * 60;
BukkitTask task = getServer().getScheduler().runTaskTimer(
    this,
    () -> getServer().broadcast(Component.text("Scheduled message")),
    initialDelay,
    period
);

Retain task as a field if another command, event, or shutdown hook must stop it. A repeating task should do only the work needed for one interval; never put an unbounded loop inside the callback.

Cancel a task deliberately

Cancel a stored task when an event ends, an administrator disables the feature, or a configuration changes:

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
private BukkitTask announcementTask;

public void startAnnouncements() {
    announcementTask = getServer().getScheduler().runTaskTimer(
        this,
        () -> getServer().broadcastMessage("Reminder"),
        0L,
        20L * 60
    );
}

public void stopAnnouncements() {
    if (announcementTask != null) {
        announcementTask.cancel();
        announcementTask = null;
    }
}

For a task that cancels itself after a condition is met, use a Consumer<BukkitTask> or a BukkitRunnable so the callback can cancel its own handle. Always guard against starting a second copy when a command is run twice.

Keep blocking I/O off the main thread

Do not call Thread.sleep() on the main thread. Sleeping there pauses tick processing and can make every player experience lag. Network requests, file operations, and database queries are appropriate candidates for an asynchronous task, but large parts of the Bukkit API are not safe from an asynchronous thread.

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

Use a two-stage pattern: perform only blocking work asynchronously, then return to the main thread for world changes, entities, inventories, broadcasts, or other Bukkit operations.

getServer().getScheduler().runTaskAsynchronously(this, () -> {
    Result result = loadFromDatabase(); // blocking I/O only

    getServer().getScheduler().runTask(this, () -> {
        // Apply the result on the main thread.
        updateWorldSafely(result);
    });
});

Protect shared data between the two stages, handle exceptions in the asynchronous portion, and decide what should happen if the plugin is disabled before the callback returns.

Create a scheduled command with a Java Edition datapack

A datapack is the simplest choice when the action can be expressed entirely with vanilla commands and does not require a plugin. The syntax below is for Minecraft Java Edition. Bedrock behavior packs use different files and command mechanics, so do not copy this layout into a Bedrock world.

Build the function file

Create a function named announce in a namespace called example. The path inside the datapack is:

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.
data/example/function/announce.mcfunction

Put one command per line in that file, without a leading slash. For example:

say The scheduled announcement is running

After the datapack is installed and loaded, run the function once to verify its namespace and path:

Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
function example:announce

If Minecraft reports that the function cannot be found, check the namespace spelling, directory names, datapack placement, and whether the pack was reloaded.

Schedule a one-time execution

From the server console or an authorized in-game command source, run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
schedule function example:announce 5m replace

The time argument can use the documented tick, seconds, and day units. The example requests execution in five minutes of game scheduling time. replace makes a new pending schedule for that function replace an existing one. Use append when each request should add another pending execution instead of resetting the existing one.

Cancel a pending function

schedule clear example:announce

Cancellation identifies the function path, so use exactly the same namespace and function name used when scheduling it.

Repeat by scheduling the next run

A function can schedule itself after it performs its work. This creates a simple recurring loop:

say The recurring function ran
schedule function example:announce 5m replace

Schedule the next run only after the current action succeeds if failure handling matters. Otherwise, a command error can leave the loop running without the intended effect. Add score, tag, or storage checks when the loop should stop after a condition.

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

Run logic every tick or initialize after loading

For work that must be checked every tick, add the function to the minecraft:tick function tag. For setup that should occur after a world load or reload, use the minecraft:load function tag. These tags are useful for initialization and lightweight checks, but an expensive function on every tick can cause lag just like an expensive plugin callback.

Keep per-tick functions small: test a narrow condition, update a score, or dispatch to another function only when needed. Use a longer /schedule interval for periodic work that does not need 20 checks per second.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Use calendar times and cron-style schedules safely

Tick scheduling cannot promise “every day at 03:00” because lag changes the relationship between ticks and real time. Some maintained scheduling plugins advertise cron expressions, command sequences, GUI editing, execution logs, conditions, and placeholders, and some claim compatibility with Paper, Spigot, and Folia. Treat those as capabilities to verify in the plugin’s current documentation before relying on them in production.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

Questions to answer before installing a scheduling plugin

  • Which Minecraft versions and server implementations are currently supported?
  • What timezone does a cron expression use: the host, the JVM, a configured zone, or UTC?
  • Does a missed run execute after a restart, get skipped, or run once immediately?
  • Are commands executed as the console, a player, or a configurable sender?
  • Can jobs be disabled, listed, edited, and cancelled without leaving duplicates?
  • Are execution results and errors written to logs?
  • Does the plugin have a documented scheduler path for Folia’s region-thread model?

Set the timezone explicitly where the plugin allows it. Test daylight-saving transitions if the schedule matters to a real-world business or event. Never assume the machine’s local timezone is the one your players expect.

Run jobs outside the Minecraft process

Use the host control panel, a service manager, or the operating system’s scheduler for backups, server restarts, uptime checks, log rotation, and jobs that must run while Minecraft is stopped. An external scheduler can start a service, invoke a backup script, or send an alert even when no game process is available to execute a command.

The exact setup depends on Linux or Windows, the service manager, account permissions, the hosting provider, and the intended timezone. Configure the scheduler under the same account that owns the server files, give scripts absolute paths, and write logs to a known location. Coordinate a backup with a safe save or shutdown procedure so the archive is not created while files are changing.

For a hosted server, look for separate controls for scheduled commands, restarts, backups, and timezone. If the panel offers only a restart schedule, it is not a general-purpose in-game command scheduler; use a plugin or datapack for commands that require a running world.

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

Make schedules survive restarts

A scheduler’s in-memory task is not durable by default. Decide explicitly what a restart means for each job:

  • Reschedule on enable: create the repeating plugin task in onEnable(), or run an initialization function from a datapack load tag.
  • Persist state: store the last execution, next due time, and completion status in a configuration or database, then calculate what to do at startup.
  • Skip missed intervals: appropriate for cosmetic announcements or cleanup where running late is worse than skipping.
  • Catch up once: appropriate for a daily tally when exactly one missed run should be recovered, but guard against running dozens of missed intervals after a long outage.
  • Delegate externally: use a host or operating-system scheduler when the job must run independently of Minecraft.

Test a real stop and start, not only a plugin reload. Confirm that a reload does not create duplicate repeating tasks and that a shutdown during asynchronous I/O cannot apply stale results after the plugin has been disabled.

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

Paper, Spigot, Bukkit, and Folia compatibility

The Bukkit scheduler pattern applies to Paper, Spigot, and Bukkit-based servers, but implementation details and supported APIs vary by version. Folia uses a region-thread model that changes how and where world operations may run. Do not assume that a conventional global scheduler task is valid for every Folia operation; use the server implementation’s documented scheduler and thread rules, and verify the plugin’s current compatibility claim.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Check the target Minecraft version, Java runtime requirement, permissions, and release history before installing a third-party scheduler. Keep a backup and a rollback plan, especially when the plugin controls commands that alter inventories, economy data, or world state.

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

Comparison: which approach fits your requirement?

Criterion Plugin scheduler Datapack Cron-style plugin External scheduler
Precision Tick-based; follows TPS Tick/second/day units; follows game scheduling Potentially wall-clock, subject to documented timezone and implementation Wall-clock, subject to host/OS clock
Survives a server restart Only if recreated or persisted Requires load logic and state planning Depends on plugin persistence and missed-run policy Independent of the game process
World and Bukkit API access Direct on the main thread Vanilla commands only Usually executes commands through the plugin Must communicate through console, files, RCON, or a service interface
Blocking I/O safety Requires async work plus a safe main-thread handoff Not suitable for arbitrary network or database code Depends on plugin implementation Can run a separate script or service
Calendar expressions Not built into the basic scheduler Not a calendar scheduler Often provided, but verify syntax and timezone Usually provided by the host or operating system
Observability Your logs and cancellation controls Command feedback and server logs May include job lists, logs, conditions, and GUI controls Host/OS logs and service status
Setup cost Java development and deployment Datapack files and command permissions Plugin installation and configuration Script, permissions, service, and timezone configuration

Practical scheduling recipes

Broadcast a warning five minutes before an event

If the warning belongs to a running minigame plugin, use runTaskLater with 20L * 60 * 5 ticks, then start the event in a second task or state transition. If the event can be started from a datapack, put the warning in a function and schedule it with schedule function. In both cases, cancel the warning when an administrator aborts the event.

Run a lightweight cleanup every ten minutes

For plugin code, use a repeating period of 20L * 60 * 10 and keep the callback bounded. For a datapack, schedule the function for 10m and have it schedule its next execution. Do not scan every entity in every world on every tick; select a narrow set or spread work across multiple runs.

Back up the server every night

Use the host or operating-system scheduler, not an in-game tick timer. Define how the service is paused or how a save is issued, where the archive is written, how long backups are retained, and what alert is sent on failure. A datapack cannot execute while the server process is stopped.

Run a command at a specific local time

Use a scheduler that lets you set the intended timezone, then test the next run with a harmless command. Record the timezone in the job’s configuration and documentation. If the server host changes timezone or daylight-saving rules, an implicit local-time schedule can shift unexpectedly.

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

Troubleshoot a task that is late, duplicated, or missing

It runs later than expected

  • Check current TPS. A tick delay expands in wall-clock time when TPS falls.
  • Look for long synchronous callbacks, world saves, or other plugins blocking the main thread.
  • Confirm that you did not convert a wall-clock requirement into ticks.
  • For calendar jobs, verify the configured timezone and daylight-saving behavior.

It runs twice

  • Ensure a repeating task is not created both in a command handler and in onEnable().
  • Cancel the old handle before replacing it during configuration reloads.
  • For datapacks, use replace when a new schedule should supersede an existing one.
  • Check that two plugins or two function paths are not issuing the same command.

It never runs

  • Confirm the plugin loaded without an exception and that the sender has permission.
  • Verify the datapack is enabled, the function namespace is exact, and the target Java Edition version supports the syntax.
  • Check that the task was not cancelled during plugin disable or a failed reload.
  • Inspect console and scheduler logs for command errors, missing worlds, or invalid selectors.

It works until a restart

The task was probably held only in memory. Recreate it during plugin enable or datapack load, persist the next due time, or move the responsibility to an external scheduler.

An asynchronous task causes errors or corrupted state

Move Bukkit and world mutations back to the main thread, protect shared state, and limit asynchronous work to blocking operations. If a result is no longer relevant after a restart or configuration change, discard it instead of applying it.

Production checklist

  1. Write down whether the trigger is tick-based or wall-clock-based.
  2. Confirm Java versus Bedrock Edition and the server implementation and version.
  3. Convert an interval to ticks only when simulation-time behavior is acceptable.
  4. Keep synchronous callbacks short and move blocking network, file, or database work off the main thread.
  5. Define restart behavior: reschedule, persist, skip, catch up once, or delegate externally.
  6. Record the timezone for every calendar schedule.
  7. Provide a cancellation path and prevent duplicate registration.
  8. Test under normal TPS and under lag, then verify logs and failure handling.
  9. Test permissions, command sender identity, datapack reloads, plugin disable, and a full server restart.
  10. For third-party plugins, verify current version support, permissions, source or release history, and a backup/rollback plan.

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.