程序包 net.md_5.bungee.api.chat

# 类 HoverEvent

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

public final class HoverEvent extends Object

- ## 嵌套类概要

  嵌套类
  修饰符和类型
  类
  说明
  `static enum`
  `HoverEvent.Action`

- ## 构造器概要

  构造器
  构造器
  说明
  `HoverEvent(HoverEvent.Action action, List<Content> contents)`
  `HoverEvent(HoverEvent.Action action, BaseComponent[] value)`
  已过时。
  `HoverEvent(Action, Content[])`
  `HoverEvent(HoverEvent.Action action, Content... contents)`
  Creates event with an action and a list of contents.

- ## 方法概要

  修饰符和类型
  方法
  说明
  `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.
  `BaseComponent[]`
  `getValue()`
  已过时。
  `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()`

  ### 从类继承的方法 java.lang.Object

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

- ## 构造器详细资料

  - ### HoverEvent

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

  - ### HoverEvent

    @Deprecated public HoverEvent(HoverEvent.Action action, BaseComponent[] value)
    已过时。
    `HoverEvent(Action, Content[])`
    Legacy constructor to create hover event.
    参数:
      `action` - the action
      `value` - the value

  - ### HoverEvent

    public HoverEvent(HoverEvent.Action action, List<Content> contents)

- ## 方法详细资料

  - ### getValue

    @Deprecated public BaseComponent[] getValue()
    已过时。

  - ### addContent

    public void addContent(Content content) throws UnsupportedOperationException
    Adds a content to this hover event.
    参数:
      `content` - the content add
    抛出:
      `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
    参数:
      `action` - the action to get for
      `array` - if to return the arrayed class
    返回:
      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()
    覆盖:
      `toString` 在类中 `Object`

  - ### equals

    public boolean equals(Object o)
    覆盖:
      `equals` 在类中 `Object`

  - ### hashCode

    public int hashCode()
    覆盖:
      `hashCode` 在类中 `Object`

  - ### setLegacy

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