public final class HoverEvent extends Object
Modifier and Type | Class and Description |
---|---|
static class |
HoverEvent.Action |
Constructor and Description |
---|
HoverEvent(HoverEvent.Action action,
BaseComponent[] value)
Deprecated.
|
HoverEvent(HoverEvent.Action action,
Content... contents)
Creates event with an action and a list of contents.
|
HoverEvent(HoverEvent.Action action,
List<Content> contents) |
Modifier and Type | Method and 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.
|
BaseComponent[] |
getValue()
Deprecated.
|
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() |
public HoverEvent(HoverEvent.Action action, Content... contents)
action
- action of this eventcontents
- array of contents, provide at least one@Deprecated public HoverEvent(HoverEvent.Action action, BaseComponent[] value)
HoverEvent(Action, Content[])
action
- the actionvalue
- the valuepublic HoverEvent(HoverEvent.Action action, List<Content> contents)
@Deprecated public BaseComponent[] getValue()
public void addContent(Content content) throws UnsupportedOperationException
content
- the content addIllegalArgumentException
- if is a legacy component and already has
a contentUnsupportedOperationException
- if content action does not match
hover event actionpublic static Class<?> getClass(HoverEvent.Action action, boolean array)
Content
class for an HoverEvent.Action
for the
GSON serializationaction
- the action to get forarray
- if to return the arrayed classpublic HoverEvent.Action getAction()
public boolean isLegacy()
public void setLegacy(boolean legacy)
Copyright © 2012–2020 SpigotMC. All rights reserved.