Interface TitleUpdater

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TitleUpdater
Updates the title of the inventory currently open for a player without forcing the player to close and reopen the GUI.

The default bean is chosen by the spigot-boot-inventory-api-nms module via InventoryApiNMS#getTitleUpdater(): for servers running 1.20 or newer it returns a Bukkit-API updater (InventoryView#setTitle), and for older servers it dispatches to a per-version NMS implementation. Users wanting a custom strategy can register their own TitleUpdater bean — the auto-configuration's factory is guarded by @ConditionalOnMissingBean.

Calling update(Player, String) when no inventory is currently open is a no-op on the Bukkit-API path; for that case there is nothing to update.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    update(org.bukkit.entity.Player player, String title)
    Replaces the title shown on the inventory the player has open.
  • Method Details

    • update

      void update(org.bukkit.entity.Player player, String title)
      Replaces the title shown on the inventory the player has open.
      Parameters:
      player - the viewer whose open inventory should be retitled
      title - the new title text