public static class HoverEvent.Action<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
private static Map<String,HoverEvent.Action> |
BY_NAME |
private Function<com.google.gson.JsonElement,T> |
deserializer |
private Function<Text,T> |
legacyDeserializer |
private String |
name |
private boolean |
parsable |
private Function<T,com.google.gson.JsonElement> |
serializer |
static HoverEvent.Action<HoverEvent.EntityContent> |
SHOW_ENTITY |
static HoverEvent.Action<HoverEvent.ItemStackContent> |
SHOW_ITEM |
static HoverEvent.Action<Text> |
SHOW_TEXT |
| Constructor and Description |
|---|
Action(String name,
boolean parsable,
Function<com.google.gson.JsonElement,T> deserializer,
Function<T,com.google.gson.JsonElement> serializer,
Function<Text,T> legacyDeserializer) |
| Modifier and Type | Method and Description |
|---|---|
HoverEvent |
buildHoverEvent(com.google.gson.JsonElement contents) |
HoverEvent |
buildHoverEvent(Text value) |
static HoverEvent.Action |
byName(String name) |
private T |
cast(Object o) |
com.google.gson.JsonElement |
contentsToJson(Object contents) |
String |
getName() |
boolean |
isParsable() |
String |
toString() |
public static final HoverEvent.Action<Text> SHOW_TEXT
public static final HoverEvent.Action<HoverEvent.ItemStackContent> SHOW_ITEM
public static final HoverEvent.Action<HoverEvent.EntityContent> SHOW_ENTITY
private static final Map<String,HoverEvent.Action> BY_NAME
private final String name
private final boolean parsable
public boolean isParsable()
public String getName()
@Nullable public static HoverEvent.Action byName(String name)
@Nullable public HoverEvent buildHoverEvent(com.google.gson.JsonElement contents)
@Nullable public HoverEvent buildHoverEvent(Text value)
public com.google.gson.JsonElement contentsToJson(Object contents)