Class HoverEvent

java.lang.Object
net.md_5.bungee.api.chat.HoverEvent

public final class HoverEvent extends Object
  • Constructor Details

    • HoverEvent

      public HoverEvent(HoverEvent.Action action, Content... contents)
      Creates event with an action and a list of contents.
      Parameters:
      action - action of this event
      contents - array of contents, provide at least one
    • HoverEvent

      @Deprecated public HoverEvent(HoverEvent.Action action, BaseComponent[] value)
      Legacy constructor to create hover event.
      Parameters:
      action - the action
      value - the value
    • HoverEvent

      public HoverEvent(HoverEvent.Action action, List<Content> contents)
      Creates a new HoverEvent instance.
      Parameters:
      action - The action of this event.
      contents - List of contents to provide for this event.
  • Method Details

    • addContent

      public void addContent(Content content) throws UnsupportedOperationException
      Adds a content to this hover event.
      Parameters:
      content - the content add
      Throws:
      IllegalArgumentException - if is a legacy component and already has a content
      UnsupportedOperationException - if content action does not match hover event action
    • getClass

      public static Class<?> getClass(HoverEvent.Action action, boolean array)
      Gets the appropriate Content class for an HoverEvent.Action for the GSON serialization
      Parameters:
      action - the action to get for
      array - if to return the arrayed class
      Returns:
      the class
    • getAction

      public HoverEvent.Action getAction()
      The action of this event.
    • getContents

      public List<Content> getContents()
      List of contents to provide for this event.
    • isLegacy

      public boolean isLegacy()
      Returns whether this hover event is prior to 1.16
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • setLegacy

      public void setLegacy(boolean legacy)
      Returns whether this hover event is prior to 1.16