Skip to content

Events, Callbacks, and Notifications

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

PluginUpdateCheckEvent (main thread)

Register like any Bukkit event. Fired after each completed check attempt.

API Meaning
getChecker() PluginUpdateChecker instance
isSuccess() Supplier/HTTP finished without throwing
getResult() NEW_VERSION_AVAILABLE, RUNNING_LATEST_VERSION, or UNKNOWN
getInstalledVersion() Version used for comparison
getLatestVersion() Resolved remote string on success; otherwise null
getRequestors() Immutable list; empty if silent check

Callbacks

  • setOnSuccess(UpdateSuccessCallback) — main thread after a successful fetch; receives requestors + latest string.
  • setOnFailure(Consumer<Throwable>) — main thread after failure; default Throwable::printStackTrace. Passing null installs a no-op handler.

Built-in notifications (optional)

One global Listener is registered once per JVM (first checker construction), using that plugin for registerEvents. If that plugin disables first while others still expect join handling, behavior is undefined; prefer a long-lived plugin or document initialization order.

Requestors (after a check)

If setNotifyRequestorsOnCheck(true) (default) and the check had requestors:

  • Players: gray/gold/red/green lines; clickable gold bold underlined links (download / paid+free labels, changelog, donate, support) with hover Link: <url>.
  • Console: bordered warning box (*), plugin name, versions, optional ChatColor prefixes if setColoredConsoleOutput(true), “Please update”, download lines (changelog not in the box), support/donate lines.

setNotifyRequestorsOnCheck(false) turns this off (events/callbacks only).

Console “up to date”

setSuppressUpToDateConsoleMessage(true) hides the console info line when you are already on the latest version (requestor flow).

Players “up to date”

setNotifyRequestorsWhenUpToDate(false) stops the “running the latest version” chat line for players who requested the check. Join notifications never show that line.

Join

After at least one check has completed (success or failure):

  • If setNotifyOperatorsOnJoin(true) and the player is op, or setNotifyPermissionOnJoin(String) is set and the player has that permission:
    • Update available: same style as the player update message.
    • Up to date: no message.
    • Failure / unknown: short “could not check” style line.

Clone this wiki locally