Interface JSONComponentSerializer.Builder
-
- Enclosing interface:
- JSONComponentSerializer
public static interface JSONComponentSerializer.Builder
A builder forJSONComponentSerializer
instances that delegates to the active serializer.- Since:
- 4.14.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JSONComponentSerializer
build()
Create a finished serializer instance.@NotNull JSONComponentSerializer.Builder
downsampleColors()
Sets that the serializer should downsample hex colors to named colors.@NotNull JSONComponentSerializer.Builder
emitLegacyHoverEvent()
Output a legacy hover eventvalue
in addition to the moderncontents
.@NotNull JSONComponentSerializer.Builder
legacyHoverEventSerializer(@Nullable LegacyHoverEventSerializer serializer)
Sets a serializer that will be used to interpret legacy hover eventvalue
payloads.
-
-
-
Method Detail
-
downsampleColors
@NotNull @NotNull JSONComponentSerializer.Builder downsampleColors()
Sets that the serializer should downsample hex colors to named colors.- Returns:
- this builder
- Since:
- 4.14.0
-
legacyHoverEventSerializer
@NotNull @NotNull JSONComponentSerializer.Builder legacyHoverEventSerializer(@Nullable @Nullable LegacyHoverEventSerializer serializer)
Sets a serializer that will be used to interpret legacy hover eventvalue
payloads. If the serializer isnull
, then onlyHoverEvent.Action.SHOW_TEXT
legacy hover events can be deserialized.- Parameters:
serializer
- serializer- Returns:
- this builder
- Since:
- 4.14.0
-
emitLegacyHoverEvent
@NotNull @NotNull JSONComponentSerializer.Builder emitLegacyHoverEvent()
Output a legacy hover eventvalue
in addition to the moderncontents
.A
legacy hover serializer
must also be set to serialize any hover events beyond those with actionHoverEvent.Action.SHOW_TEXT
- Returns:
- this builder
- Since:
- 4.14.0
-
build
JSONComponentSerializer build()
Create a finished serializer instance.- Returns:
- the new serializer
- Since:
- 4.14.0
-
-