Interface Displayable

All Known Implementing Classes:
Protection

public interface Displayable
Used to define a contract for per-player ItemStack creation in UIs.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull org.bukkit.inventory.ItemStack
    getDisplay(@NotNull org.bukkit.entity.Player uiHolder)
    Create a new ItemStack for usage in UIs.
    @Nullable Consumer<? super org.bukkit.event.inventory.InventoryClickEvent>
    Get the click action associated with this display item.
  • Method Details

    • getDisplay

      @NotNull @NotNull org.bukkit.inventory.ItemStack getDisplay(@NotNull @NotNull org.bukkit.entity.Player uiHolder)
      Create a new ItemStack for usage in UIs.

      Requires a Player for server-side translations of names and item lore and other data.

      Parameters:
      uiHolder - The Player that the item is show to
      Returns:
      The ItemStack to display to the player
    • getDisplayAction

      @Nullable @Nullable Consumer<? super org.bukkit.event.inventory.InventoryClickEvent> getDisplayAction()
      Get the click action associated with this display item.

      Returning null indicates that the display item has no click handler and should not perform any action when clicked.

      Returns:
      The Consumer to invoke when the item is clicked, or null if no click action is defined