Package net.md_5.bungee.api.chat

# Class HoverEvent

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

public final class HoverEvent extends Object

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `HoverEvent.Action`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `HoverEvent(HoverEvent.Action action, List<Content> contents)`
  Creates a new `HoverEvent` instance.
  `HoverEvent(HoverEvent.Action action, BaseComponent[] value)`
  Deprecated.
  `HoverEvent(Action, Content[])`
  `HoverEvent(HoverEvent.Action action, Content... contents)`
  Creates event with an action and a list of contents.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addContent(Content content)`
  Adds a content to this hover event.
  `boolean`
  `equals(Object o)`
  `HoverEvent.Action`
  `getAction()`
  The action of this event.
  `static Class<?>`
  `getClass(HoverEvent.Action action, boolean array)`
  Gets the appropriate `Content` class for an `HoverEvent.Action` for the GSON serialization
  `List<Content>`
  `getContents()`
  List of contents to provide for this event.
  `int`
  `hashCode()`
  `boolean`
  `isLegacy()`
  Returns whether this hover event is prior to 1.16
  `void`
  `setLegacy(boolean legacy)`
  Returns whether this hover event is prior to 1.16
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## 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)
    Deprecated.
    `HoverEvent(Action, Content[])`
    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