Class JSONOptions
- java.lang.Object
-
- net.kyori.adventure.text.serializer.json.JSONOptions
-
public final class JSONOptions extends java.lang.Object
Options that can apply to JSON serializers.See serializer documentation for specific details on which flags are supported.
- Since:
- 4.15.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JSONOptions.HoverEventValueMode
Configure how to emit hover event values.static class
JSONOptions.ShowItemHoverDataMode
Configure how to emit show_item hovers.
-
Field Summary
Fields Modifier and Type Field Description static net.kyori.option.Option<java.lang.Boolean>
EMIT_COMPACT_TEXT_COMPONENT
Whether to emit text components with no style and no children as plain text.static net.kyori.option.Option<java.lang.Boolean>
EMIT_DEFAULT_ITEM_HOVER_QUANTITY
Whether to emit the default hover event item stack quantity of1
.static net.kyori.option.Option<JSONOptions.HoverEventValueMode>
EMIT_HOVER_EVENT_TYPE
Control how hover event values should be emitted.static net.kyori.option.Option<java.lang.Boolean>
EMIT_HOVER_SHOW_ENTITY_ID_AS_INT_ARRAY
Whether to emit the hover event show entity action's entity UUID as an int array, as understood by 1.20.3+, or as a string as understood by previous versions.static net.kyori.option.Option<java.lang.Boolean>
EMIT_RGB
Whether to emit RGB text.static net.kyori.option.Option<JSONOptions.ShowItemHoverDataMode>
SHOW_ITEM_HOVER_DATA_MODE
How to emit the item data onshow_item
hover events.static net.kyori.option.Option<java.lang.Boolean>
VALIDATE_STRICT_EVENTS
Whether to be strict about accepting invalid hover/click events.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NotNull net.kyori.option.OptionState.Versioned
byDataVersion()
Get JSON flags delineated by world data version.static @NotNull net.kyori.option.OptionState
compatibility()
The combination of flags that can be understood by modern clients, as well as as far back as possible.
-
-
-
Field Detail
-
EMIT_RGB
public static final net.kyori.option.Option<java.lang.Boolean> EMIT_RGB
Whether to emit RGB text.If this attribute is disabled, colors in styles will be downsampled to the classic 16 colors.
- Since:
- 4.15.0
- Since Minecraft:
- 1.16
-
EMIT_HOVER_EVENT_TYPE
public static final net.kyori.option.Option<JSONOptions.HoverEventValueMode> EMIT_HOVER_EVENT_TYPE
Control how hover event values should be emitted.- Since:
- 4.15.0
-
EMIT_COMPACT_TEXT_COMPONENT
public static final net.kyori.option.Option<java.lang.Boolean> EMIT_COMPACT_TEXT_COMPONENT
Whether to emit text components with no style and no children as plain text.- Since:
- 4.15.0
- Since Minecraft:
- 1.20.3
-
EMIT_HOVER_SHOW_ENTITY_ID_AS_INT_ARRAY
public static final net.kyori.option.Option<java.lang.Boolean> EMIT_HOVER_SHOW_ENTITY_ID_AS_INT_ARRAY
Whether to emit the hover event show entity action's entity UUID as an int array, as understood by 1.20.3+, or as a string as understood by previous versions.- Since:
- 4.15.0
-
VALIDATE_STRICT_EVENTS
public static final net.kyori.option.Option<java.lang.Boolean> VALIDATE_STRICT_EVENTS
Whether to be strict about accepting invalid hover/click events.When enabled, this matches Vanilla as of 1.20.3.
- Since:
- 4.15.0
-
EMIT_DEFAULT_ITEM_HOVER_QUANTITY
public static final net.kyori.option.Option<java.lang.Boolean> EMIT_DEFAULT_ITEM_HOVER_QUANTITY
Whether to emit the default hover event item stack quantity of1
.When enabled, this matches Vanilla as of 1.20.5.
- Since:
- 4.17.0
-
SHOW_ITEM_HOVER_DATA_MODE
public static final net.kyori.option.Option<JSONOptions.ShowItemHoverDataMode> SHOW_ITEM_HOVER_DATA_MODE
How to emit the item data onshow_item
hover events.- Since:
- 4.17.0
-
-
Method Detail
-
byDataVersion
public static @NotNull net.kyori.option.OptionState.Versioned byDataVersion()
Get JSON flags delineated by world data version.- Returns:
- the versioned flag set
- Since:
- 4.15.0
-
compatibility
@NotNull public static @NotNull net.kyori.option.OptionState compatibility()
The combination of flags that can be understood by modern clients, as well as as far back as possible.This may provide a less efficient representation of components.
- Returns:
- the most widely compatible feature flag set
- Since:
- 4.15.0
-
-