Interface Button

All Known Implementing Classes:
AnimatedButton, InputButton, ListButton, MultiButton, OutputButton, PredicateButton, SimpleButton

public interface Button
Represents a button that can apply actions to an ActionItem based on a player's UUID. Buttons are used in GUI systems to define interactive elements that respond to player actions.

Example implementation:


 public class MyButton implements Button {
     @Override
     public boolean apply(UUID uuid, ActionItem actionItem) {
         actionItem.setItem("My Button");
         actionItem.setAction(event -> System.out.println("Button clicked by " + uuid));
         return true;
     }
 }
 
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(@NotNull UUID uuid)
    Get a consumer that applies actions to the action item
    boolean
    apply(@NotNull UUID uuid, @NotNull ActionItem actionItem)
    Apply actions to the action item
  • Method Details

    • apply

      boolean apply(@NotNull @NotNull UUID uuid, @NotNull @NotNull ActionItem actionItem)
      Apply actions to the action item
      Parameters:
      uuid - the uuid of the player
      actionItem - the action item
      Returns:
      true if any action was applied. Can return false in a conditional case (e.g. predicate button)
    • apply

      default Consumer<ActionItem> apply(@NotNull @NotNull UUID uuid)
      Get a consumer that applies actions to the action item
      Parameters:
      uuid - the uuid of the player
      Returns:
      the consumer