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 TypeMethodDescription@NotNull org.bukkit.inventory.ItemStackgetDisplay(@NotNull org.bukkit.entity.Player uiHolder) Create a newItemStackfor 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 newItemStackfor usage in UIs.Requires a
Playerfor server-side translations of names and item lore and other data.- Parameters:
uiHolder- ThePlayerthat the item is show to- Returns:
- The
ItemStackto 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
nullindicates that the display item has no click handler and should not perform any action when clicked.- Returns:
- The
Consumerto invoke when the item is clicked, ornullif no click action is defined
-