Class ComponentSerializers
java.lang.Object
com.cotani.text.ComponentSerializers
Centralizes the standard Adventure component serializers as reusable, immutable singletons.
Adventure serializers are thread-safe and can be shared across the application. This class provides a single point of access for the most common serializers, avoiding repeated lookups and scattered imports.
For custom serializer configurations (strict MiniMessage, custom tag resolvers, legacy RGB support, etc.), create dedicated instances and expose them through application-specific constants.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.kyori.adventure.text.serializer.gson.GsonComponentSerializerThe standard Gson component serializer for modern Minecraft JSON chat components.static final net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializerThe legacy serializer using the ampersand symbol (&).static final net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializerThe legacy serializer using the section symbol (§).static final net.kyori.adventure.text.minimessage.MiniMessageThe default MiniMessage serializer with the standard tag set.static final net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializerThe plain text serializer. -
Method Summary
-
Field Details
-
GSON
public static final net.kyori.adventure.text.serializer.gson.GsonComponentSerializer GSONThe standard Gson component serializer for modern Minecraft JSON chat components.Prefer this serializer for persistence, configuration files, and databases where RGB colors and modern hover events are acceptable.
-
PLAIN
public static final net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer PLAINThe plain text serializer. Useful for logging, clearing formatting, or extracting raw text. -
LEGACY_SECTION
public static final net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer LEGACY_SECTIONThe legacy serializer using the section symbol (§). Useful for legacy compatibility or displaying formatted text in old clients. -
LEGACY_AMPERSAND
public static final net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer LEGACY_AMPERSANDThe legacy serializer using the ampersand symbol (&). Commonly used in configuration files and command outputs. -
MINIMESSAGE
public static final net.kyori.adventure.text.minimessage.MiniMessage MINIMESSAGEThe default MiniMessage serializer with the standard tag set.
-