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 TypeMethodDescriptiondefault Consumer<ActionItem> Get a consumer that applies actions to the action itembooleanapply(@NotNull UUID uuid, @NotNull ActionItem actionItem) Apply actions to the action item
-
Method Details
-
apply
Apply actions to the action item- Parameters:
uuid- the uuid of the playeractionItem- the action item- Returns:
- true if any action was applied. Can return false in a conditional case (e.g. predicate button)
-
apply
Get a consumer that applies actions to the action item- Parameters:
uuid- the uuid of the player- Returns:
- the consumer
-