Skip to content

Running & Scheduling Update Checks

Jeremy Fail edited this page Apr 4, 2026 · 2 revisions

Running & Scheduling Update Checks

Method Behavior
checkNow() Starts a check; uses the console as requestor for built-in requestor messaging.
checkNow(Collection<? extends CommandSender> requestors) Same; null or empty = silent (no requestor-driven built-in messages).
scheduleRepeating(long amount, TimeUnit unit) Repeating task: interval converted to ticks (millis / 50, minimum 1). First run is after one full interval, not immediately. Replaces any previous schedule (cancels the old task). Scheduled runs use silent checks (empty requestors).
cancelScheduledChecks() Cancels the repeating task.

Async work uses the server scheduler; results, PluginUpdateCheckEvent, and callbacks run synchronously on the main thread.

Scheduler reuse

getScheduler() returns UpdateScheduler: runAsync, runSync, runSyncRepeating, cancelTask, backed by your plugin’s BukkitScheduler. Use it if you want other work to follow the same async/sync rules as the checker.

HTTP / User-Agent

  • Default User-Agent (if you do not set a full override): PluginUpdateChecker/<VERSION> (<plugin>/<version>; Minecraft/...; Bukkit/...; optional paid; optional uid/...; plus extra segments from UserAgentBuilder`).
  • setUserAgent(String) — full override; null or empty restores default composition.
  • getDefaultUserAgentBuilder() — append segments: appendRaw, appendPlugin, appendServerVersion, appendPaidVersion, appendUserId.
  • setUserAgentResourceUserId(String) — adds uid/... in the default UA (for future marketplace-style use).
  • setConnectTimeoutMs(int)HttpURLConnection connect timeout; 0 = do not set (JVM default). Read timeout is not set by this library.

Clone this wiki locally