Package net.md_5.bungee.api.chat
Class HoverEvent
java.lang.Object
net.md_5.bungee.api.chat.HoverEvent
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionHoverEvent(HoverEvent.Action action, List<Content> contents) Creates a newHoverEventinstance.HoverEvent(HoverEvent.Action action, BaseComponent[] value) Deprecated.HoverEvent(HoverEvent.Action action, Content... contents) Creates event with an action and a list of contents. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddContent(Content content) Adds a content to this hover event.booleanThe action of this event.static Class<?>getClass(HoverEvent.Action action, boolean array) Gets the appropriateContentclass for anHoverEvent.Actionfor the GSON serializationList of contents to provide for this event.inthashCode()booleanisLegacy()Returns whether this hover event is prior to 1.16voidsetLegacy(boolean legacy) Returns whether this hover event is prior to 1.16toString()
-
Constructor Details
-
HoverEvent
Creates event with an action and a list of contents.- Parameters:
action- action of this eventcontents- array of contents, provide at least one
-
HoverEvent
Deprecated.Legacy constructor to create hover event.- Parameters:
action- the actionvalue- the value
-
HoverEvent
Creates a newHoverEventinstance.- Parameters:
action- The action of this event.contents- List of contents to provide for this event.
-
-
Method Details
-
addContent
Adds a content to this hover event.- Parameters:
content- the content add- Throws:
IllegalArgumentException- if is a legacy component and already has a contentUnsupportedOperationException- if content action does not match hover event action
-
getClass
Gets the appropriateContentclass for anHoverEvent.Actionfor the GSON serialization- Parameters:
action- the action to get forarray- if to return the arrayed class- Returns:
- the class
-
getAction
The action of this event. -
getContents
List of contents to provide for this event. -
isLegacy
public boolean isLegacy()Returns whether this hover event is prior to 1.16 -
toString
-
equals
-
hashCode
public int hashCode() -
setLegacy
public void setLegacy(boolean legacy) Returns whether this hover event is prior to 1.16
-
HoverEvent(Action, Content[])