Class JSONOptions
java.lang.Object
net.kyori.adventure.text.serializer.json.JSONOptions
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 ClassesModifier and TypeClassDescriptionstatic enum
Configure how to emit click event values.static enum
Configure how to emit hover event values.static enum
How text shadow colors should be emitted.static enum
Configure how to emit show_item hovers. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.kyori.option.Option<JSONOptions.ClickEventValueMode>
Control how click event values should be emitted.static final net.kyori.option.Option<Boolean>
Whether to emit text components with no style and no children as plain text.static final net.kyori.option.Option<Boolean>
Whether to emit the default hover event item stack quantity of1
.static final net.kyori.option.Option<JSONOptions.HoverEventValueMode>
Control how hover event values should be emitted.static final net.kyori.option.Option<Boolean>
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 final net.kyori.option.Option<Boolean>
Whether to emit the hover event show entity action's entity type key as atype
and UUID as anid
, as it was before 1.21.5.static final net.kyori.option.Option<Boolean>
Whether to emit RGB text.static final net.kyori.option.Option<JSONOptions.ShadowColorEmitMode>
How to emit shadow colour data.static final net.kyori.option.Option<JSONOptions.ShowItemHoverDataMode>
How to emit the item data onshow_item
hover events.static final net.kyori.option.Option<Boolean>
Whether to be strict about accepting invalid hover/click events. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull net.kyori.option.OptionState.Versioned
Get JSON flags delineated by world data version.static @NotNull net.kyori.option.OptionState
The combination of flags that can be understood by modern clients, as well as as far back as possible.static @NotNull net.kyori.option.OptionSchema
schema()
A schema of available options.
-
Field Details
-
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
Control how hover event values should be emitted.- Since:
- 4.15.0
-
EMIT_CLICK_EVENT_TYPE
Control how click event values should be emitted.- Since:
- 4.20.0
-
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
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
-
EMIT_HOVER_SHOW_ENTITY_KEY_AS_TYPE_AND_UUID_AS_ID
public static final net.kyori.option.Option<Boolean> EMIT_HOVER_SHOW_ENTITY_KEY_AS_TYPE_AND_UUID_AS_IDWhether to emit the hover event show entity action's entity type key as atype
and UUID as anid
, as it was before 1.21.5.- Since:
- 4.20.0
-
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
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_MODEHow to emit the item data onshow_item
hover events.- Since:
- 4.17.0
-
SHADOW_COLOR_MODE
How to emit shadow colour data.- Since:
- 4.18.0
-
-
Method Details
-
schema
@NotNull public static @NotNull net.kyori.option.OptionSchema schema()A schema of available options.- Returns:
- the schema of known json options
- Since:
- 4.20.0
-
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
-