Class JSONOptions

java.lang.Object
net.kyori.adventure.text.serializer.json.JSONOptions

public final class JSONOptions extends Object
Options that can apply to JSON serializers.

See serializer documentation for specific details on which flags are supported.

Since:
4.15.0
  • Field Details

    • EMIT_RGB

      public static final net.kyori.option.Option<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<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<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<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<Boolean> EMIT_DEFAULT_ITEM_HOVER_QUANTITY
      Whether to emit the default hover event item stack quantity of 1.

      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 on show_item hover events.
      Since:
      4.17.0
    • SHADOW_COLOR_MODE

      public static final net.kyori.option.Option<JSONOptions.ShadowColorEmitMode> SHADOW_COLOR_MODE
      How to emit shadow colour data.
      Since:
      4.18.0
  • Method Details

    • 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