Interface TextContent

All Known Subinterfaces:
PlainTextContent
All Known Implementing Classes:
KeybindTextContent, NbtTextContent, PlainTextContent.Literal, ScoreTextContent, SelectorTextContent, TranslatableTextContent

public interface TextContent
Represents type-specific content of text. It is stored in each tree node in a text tree structure. Its implementations are immutable.
Mappings:
Namespace Name
official vg
intermediary net/minecraft/class_7417
named net/minecraft/text/TextContent
  • Method Details

    • visit

      default <T> Optional<T> visit(StringVisitable.StyledVisitor<T> visitor, Style style)
      Visits this content. Returns a value if the visitor terminates amid the visit, or Optional.empty() if it proceeds.
      Returns:
      Optional.empty() if the visit finished, or a terminating result from the visitor
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lvg;a(Lvk$b;Lwc;)Ljava/util/Optional;
      intermediary method_27660 Lnet/minecraft/class_7417;method_27660(Lnet/minecraft/class_5348$class_5246;Lnet/minecraft/class_2583;)Ljava/util/Optional;
      named visit Lnet/minecraft/text/TextContent;visit(Lnet/minecraft/text/StringVisitable$StyledVisitor;Lnet/minecraft/text/Style;)Ljava/util/Optional;
    • visit

      default <T> Optional<T> visit(StringVisitable.Visitor<T> visitor)
      Visits this content. Returns a value if the visitor terminates amid the visit, or Optional.empty() if it proceeds.
      Returns:
      Optional.empty() if the visit finished, or a terminating result from the visitor
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lvg;a(Lvk$a;)Ljava/util/Optional;
      intermediary method_27659 Lnet/minecraft/class_7417;method_27659(Lnet/minecraft/class_5348$class_5245;)Ljava/util/Optional;
      named visit Lnet/minecraft/text/TextContent;visit(Lnet/minecraft/text/StringVisitable$Visitor;)Ljava/util/Optional;
    • parse

      default MutableText parse(@Nullable @Nullable ServerCommandSource source, @Nullable @Nullable Entity sender, int depth) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Parses this content into a basic mutable text without custom style or siblings. The resulting text may or may not have this content.
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
      Mappings:
      Namespace Name Mixin selector
      official a Lvg;a(Lds;Lblv;I)Lvt;
      intermediary method_10890 Lnet/minecraft/class_7417;method_10890(Lnet/minecraft/class_2168;Lnet/minecraft/class_1297;I)Lnet/minecraft/class_5250;
      named parse Lnet/minecraft/text/TextContent;parse(Lnet/minecraft/server/command/ServerCommandSource;Lnet/minecraft/entity/Entity;I)Lnet/minecraft/text/MutableText;
    • getType

      TextContent.Type<?> getType()
      Mappings:
      Namespace Name Mixin selector
      official a Lvg;a()Lvg$a;
      intermediary method_54163 Lnet/minecraft/class_7417;method_54163()Lnet/minecraft/class_7417$class_8823;
      named getType Lnet/minecraft/text/TextContent;getType()Lnet/minecraft/text/TextContent$Type;