Interface LegacyComponentSerializer
- 
- All Superinterfaces:
- Buildable<LegacyComponentSerializer,LegacyComponentSerializer.Builder>,- ComponentSerializer<Component,TextComponent,String>
 
 public interface LegacyComponentSerializer extends ComponentSerializer<Component,TextComponent,String>, Buildable<LegacyComponentSerializer,LegacyComponentSerializer.Builder> A legacy component serializer.Legacy does not support more complex features such as, but not limited to, ClickEventandHoverEvent.- Since:
- 4.0.0
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static interfaceLegacyComponentSerializer.BuilderA builder forLegacyComponentSerializer.static interfaceLegacyComponentSerializer.ProviderALegacyComponentSerializerservice provider.
 - 
Field SummaryFields Modifier and Type Field Description static charAMPERSAND_CHARThe legacy character frequently used by configurations and commands.static charHEX_CHARThe legacy character used to prefix hex colors.static charSECTION_CHARThe legacy character used by Minecraft.
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static @NotNull LegacyComponentSerializer.Builderbuilder()Creates a newLegacyComponentSerializer.Builder.@NotNull TextComponentdeserialize(@NotNull String input)Deserialize a component from a legacyString.static @NotNull LegacyComponentSerializerlegacy(char legacyCharacter)Gets a component serializer for legacy-based serialization and deserialization.static @NotNull LegacyComponentSerializerlegacyAmpersand()Gets a component serializer for legacy-based serialization and deserialization.static @NotNull LegacyComponentSerializerlegacySection()Gets a component serializer for legacy-based serialization and deserialization.static @Nullable LegacyFormatparseChar(char character)Converts a legacy character (0123456789abcdefklmnor) to a legacy format, when possible.@NotNull Stringserialize(@NotNull Component component)Serializes a component into a legacyString.- 
Methods inherited from interface net.kyori.adventure.text.serializer.ComponentSerializerdeseializeOrNull, deserializeOr, deserializeOrNull, serializeOr, serializeOrNull
 
- 
 
- 
- 
- 
Field Detail- 
SECTION_CHARstatic final char SECTION_CHAR The legacy character used by Minecraft. ('ยง')- Since:
- 4.0.0
- See Also:
- Constant Field Values
 
 - 
AMPERSAND_CHARstatic final char AMPERSAND_CHAR The legacy character frequently used by configurations and commands. ('&')- Since:
- 4.0.0
- See Also:
- Constant Field Values
 
 - 
HEX_CHARstatic final char HEX_CHAR The legacy character used to prefix hex colors. ('#')- Since:
- 4.0.0
- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
legacySection@NotNull static @NotNull LegacyComponentSerializer legacySection() Gets a component serializer for legacy-based serialization and deserialization. Note that this serializer works exactly like vanilla Minecraft and does not detect any links. If you want to detect and make URLs clickable, useLegacyComponentSerializer.Builder.extractUrls().The returned serializer uses the sectioncharacter.- Returns:
- a component serializer for legacy serialization and deserialization
- Since:
- 4.0.0
 
 - 
legacyAmpersand@NotNull static @NotNull LegacyComponentSerializer legacyAmpersand() Gets a component serializer for legacy-based serialization and deserialization. Note that this serializer works exactly like vanilla Minecraft and does not detect any links. If you want to detect and make URLs clickable, useLegacyComponentSerializer.Builder.extractUrls().The returned serializer uses the ampersandcharacter.- Returns:
- a component serializer for legacy serialization and deserialization
- Since:
- 4.0.0
 
 - 
legacy@NotNull static @NotNull LegacyComponentSerializer legacy(char legacyCharacter) Gets a component serializer for legacy-based serialization and deserialization. Note that this serializer works exactly like vanilla Minecraft and does not detect any links. If you want to detect and make URLs clickable, useLegacyComponentSerializer.Builder.extractUrls().- Parameters:
- legacyCharacter- the legacy character to use
- Returns:
- a component serializer for legacy serialization and deserialization
- Since:
- 4.0.0
 
 - 
parseChar@Nullable static @Nullable LegacyFormat parseChar(char character) Converts a legacy character (0123456789abcdefklmnor) to a legacy format, when possible.- Parameters:
- character- the legacy character
- Returns:
- the legacy format
- Since:
- 4.0.0
 
 - 
builder@NotNull static @NotNull LegacyComponentSerializer.Builder builder() Creates a newLegacyComponentSerializer.Builder.- Returns:
- the builder
- Since:
- 4.0.0
 
 - 
deserialize@NotNull @NotNull TextComponent deserialize(@NotNull @NotNull String input) Deserialize a component from a legacyString.- Specified by:
- deserializein interface- ComponentSerializer<Component,TextComponent,String>
- Parameters:
- input- the input
- Returns:
- the component
 
 - 
serialize@NotNull @NotNull String serialize(@NotNull @NotNull Component component) Serializes a component into a legacyString.- Specified by:
- serializein interface- ComponentSerializer<Component,TextComponent,String>
- Parameters:
- component- the component
- Returns:
- the string
 
 
- 
 
-