Interface MenuConditionContext


public interface MenuConditionContext
What an add-on condition, value or resolver is asked about: one viewer, the menu they are opening or looking at, and the moment the menu is being decided.

A context is only valid during the call it is passed to, which always runs on the main thread. Keep the work quick: it runs every time the menu opens or redraws.

Since:
1.15.0
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull MenuView
    What the menu shows right now.
    default @NotNull String
    The menu's ID in guis.yml; the same as getMenu().menuId().
    @NotNull ZonedDateTime
    The moment the menu is being decided, in the time zone of backgrounds.timezone in guis.yml (the server's own when unset).
    @NotNull org.bukkit.entity.Player
    The player looking at the menu.
  • Method Details

    • getPlayer

      @NotNull @NotNull org.bukkit.entity.Player getPlayer()
      The player looking at the menu.
    • getMenu

      @NotNull @NotNull MenuView getMenu()
      What the menu shows right now. Its background is null, because the background is what is being decided.
    • getMenuId

      @NotNull default @NotNull String getMenuId()
      The menu's ID in guis.yml; the same as getMenu().menuId().
    • getNow

      @NotNull @NotNull ZonedDateTime getNow()
      The moment the menu is being decided, in the time zone of backgrounds.timezone in guis.yml (the server's own when unset). It is the same for every condition of one decision.