public final class HoverEvent
extends java.lang.Object
A hover event displays a component when hovered
over by a mouse on the client.
| Modifier and Type | Class and Description |
|---|---|
static class |
HoverEvent.Action
An enumeration of hover event actions.
|
| Modifier and Type | Method and Description |
|---|---|
@NonNull HoverEvent.Action |
action()
Gets the hover event action.
|
boolean |
equals(@Nullable java.lang.Object other) |
int |
hashCode() |
static @NonNull HoverEvent |
of(@NonNull HoverEvent.Action action,
@NonNull Component value)
Creates a hover event.
|
static @NonNull HoverEvent |
showEntity(@NonNull Component entity)
Creates a hover event that shows an entity on hover.
|
static @NonNull HoverEvent |
showItem(@NonNull Component item)
Creates a hover event that shows an item on hover.
|
static @NonNull HoverEvent |
showText(@NonNull Component text)
Creates a hover event that shows text on hover.
|
java.lang.String |
toString() |
@NonNull Component |
value()
Gets the hover event value.
|
public static @NonNull HoverEvent of(@NonNull HoverEvent.Action action, @NonNull Component value)
action - the actionvalue - the valuepublic static @NonNull HoverEvent showText(@NonNull Component text)
text - the text to show on hoverpublic static @NonNull HoverEvent showItem(@NonNull Component item)
item - the item to show on hoverpublic static @NonNull HoverEvent showEntity(@NonNull Component entity)
entity - the entity to show on hoverpublic @NonNull HoverEvent.Action action()
public @NonNull Component value()
public boolean equals(@Nullable java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object