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 classHoverEvent.Action
-
Constructor Summary
Constructors Constructor Description HoverEvent(HoverEvent.Action action, List<Content> contents)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
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddContent(Content content)Adds a content to this hover event.booleanequals(Object o)HoverEvent.ActiongetAction()The action of this event.static Class<?>getClass(HoverEvent.Action action, boolean array)Gets the appropriateContentclass for anHoverEvent.Actionfor the GSON serializationList<Content>getContents()List of contents to provide for this event.BaseComponent[]getValue()Deprecated.inthashCode()booleanisLegacy()Returns whether this hover event is prior to 1.16voidsetLegacy(boolean legacy)Returns whether this hover event is prior to 1.16StringtoString()
-
-
-
Constructor Detail
-
HoverEvent
public HoverEvent(HoverEvent.Action action, Content... contents)
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 public HoverEvent(HoverEvent.Action action, BaseComponent[] value)
Deprecated.Legacy constructor to create hover event.- Parameters:
action- the actionvalue- the value
-
HoverEvent
public HoverEvent(HoverEvent.Action action, List<Content> contents)
-
-
Method Detail
-
getValue
@Deprecated public BaseComponent[] getValue()
Deprecated.
-
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 contentUnsupportedOperationException- if content action does not match hover event action
-
getClass
public static Class<?> getClass(HoverEvent.Action action, boolean array)
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
public HoverEvent.Action getAction()
The action of this event.
-
isLegacy
public boolean isLegacy()
Returns whether this hover event is prior to 1.16
-
setLegacy
public void setLegacy(boolean legacy)
Returns whether this hover event is prior to 1.16
-
-