Interface GuiItem


public interface GuiItem
Represents an interactive item slot in a GUI layout layer.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Builder interface for constructing GuiItems.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a new builder for constructing a GuiItem.
    @NotNull org.bukkit.inventory.ItemStack
    getItemStack(@NotNull org.bukkit.entity.Player player)
    Resolves the ItemStack representation for the specified player.
    void
    onClick(@NotNull GuiClickContext context)
    Executes the interaction callback when this item is clicked.
    boolean
    shouldRender(@NotNull org.bukkit.entity.Player player)
    Checks if this item should be rendered for the specified player.
  • Method Details

    • getItemStack

      @NotNull @NotNull org.bukkit.inventory.ItemStack getItemStack(@NotNull @NotNull org.bukkit.entity.Player player)
      Resolves the ItemStack representation for the specified player.
      Parameters:
      player - the viewer player
      Returns:
      the rendered item stack
    • shouldRender

      boolean shouldRender(@NotNull @NotNull org.bukkit.entity.Player player)
      Checks if this item should be rendered for the specified player.
      Parameters:
      player - the viewer player
      Returns:
      true if it should render, false otherwise
    • onClick

      void onClick(@NotNull @NotNull GuiClickContext context)
      Executes the interaction callback when this item is clicked.
      Parameters:
      context - the click context details
    • builder

      static GuiItem.Builder builder()
      Creates a new builder for constructing a GuiItem.
      Returns:
      a new GuiItem builder
      Throws:
      IllegalStateException - if the GUI API provider is not registered