Class Action

java.lang.Object
com.kamikazejam.kamicommon.actions.StandaloneAction
com.kamikazejam.kamicommon.actions.Action

public class Action extends com.kamikazejam.kamicommon.actions.StandaloneAction
Wrapper class for basic expression of chat message actions. Extends StandaloneAction, adds hover item chat action HoverItem
  • Constructor Details

    • Action

      public Action(@NotNull @NotNull String placeholder, @NotNull @NotNull String replacement)
      Create a new empty Action with a placeholder and its replacement text.
      Use setters to add actions to this object.
      Parameters:
      placeholder - The placeholder in the message string to replace
      replacement - The text to replace the placeholder with
  • Method Details

    • setHoverItem

      public Action setHoverItem(@NotNull @NotNull ItemStack item)
      Parameters:
      item - The ItemStack to show when hovering over this action's text
    • setClickRunCommand

      public Action setClickRunCommand(@NotNull @NotNull String command)
      Note: the command does not need to start with a slash (/). It will be automatically added if necessary.
      Overrides:
      setClickRunCommand in class com.kamikazejam.kamicommon.actions.StandaloneAction
      Parameters:
      command - The command to run, when this action's text is clicked.
    • setClickSuggestCommand

      public Action setClickSuggestCommand(@NotNull @NotNull String suggestion)
      Overrides:
      setClickSuggestCommand in class com.kamikazejam.kamicommon.actions.StandaloneAction
      Parameters:
      suggestion - The chatbox text to suggest to the player, when this action's text is clicked
    • setClickOpenURL

      public Action setClickOpenURL(@NotNull @NotNull String url)
      Overrides:
      setClickOpenURL in class com.kamikazejam.kamicommon.actions.StandaloneAction
      Parameters:
      url - The url to open, when this action's text is clicked
    • setHoverText

      public Action setHoverText(@NotNull @NotNull String text)
      Overrides:
      setHoverText in class com.kamikazejam.kamicommon.actions.StandaloneAction
      Parameters:
      text - The text to show when this action's text is hovered over