Interface NarrationMessageBuilder

All Known Implementing Classes:
ScreenNarrator.MessageBuilder

@Environment(CLIENT) public interface NarrationMessageBuilder
A builder for narration messages.

Narration messages consist of multiple sections known as parts. Each narration message can contain only one narration per part.

You can create a submessage by calling nextMessage(). Each submessage can have its own set of narrations for the different narration parts.

The narrations added to a message will be ordered by their part first, in NarrationPart's natural ordering. If there are multiple narrations for a part added through submessages, they will be ordered earliest submessage first.

Mappings:
Namespace Name
named net/minecraft/client/gui/screen/narration/NarrationMessageBuilder
intermediary net/minecraft/class_6382
official flc
  • Method Details

    • put

      default void put(NarrationPart part, Text text)
      Adds a Text narration to this message builder.

      If a narration already exists for the specified narration part, it is replaced by the new narration.

      Parameters:
      text - the message for the narration
      Implementation Requirements:
      The default implementation behaves like put(part, text.getString()).
      Mappings:
      Namespace Name Mixin selector
      named put Lnet/minecraft/client/gui/screen/narration/NarrationMessageBuilder;put(Lnet/minecraft/client/gui/screen/narration/NarrationPart;Lnet/minecraft/text/Text;)V
      intermediary method_37034 Lnet/minecraft/class_6382;method_37034(Lnet/minecraft/class_6381;Lnet/minecraft/class_2561;)V
      official a Lflc;a(Lflb;Lxp;)V
    • put

      default void put(NarrationPart part, String string)
      Adds a string narration to this message builder.

      If a narration already exists for the specified narration part, it is replaced by the new narration.

      Parameters:
      string - the message for the narration
      Mappings:
      Namespace Name Mixin selector
      named put Lnet/minecraft/client/gui/screen/narration/NarrationMessageBuilder;put(Lnet/minecraft/client/gui/screen/narration/NarrationPart;Ljava/lang/String;)V
      intermediary method_37033 Lnet/minecraft/class_6382;method_37033(Lnet/minecraft/class_6381;Ljava/lang/String;)V
      official a Lflc;a(Lflb;Ljava/lang/String;)V
    • put

      default void put(NarrationPart part, Text[] texts)
      Adds an array of Text narrations to this message builder.

      Each Text in the input array will be its own sentence as described in Narration.texts(java.util.List<net.minecraft.text.Text>).

      If a narration already exists for the specified narration part, it is replaced by the new narration.

      Parameters:
      texts - the messages for the narration
      Implementation Requirements:
      The default implementation creates a Narration for the texts using Narration.texts(java.util.List<net.minecraft.text.Text>).
      Mappings:
      Namespace Name Mixin selector
      named put Lnet/minecraft/client/gui/screen/narration/NarrationMessageBuilder;put(Lnet/minecraft/client/gui/screen/narration/NarrationPart;[Lnet/minecraft/text/Text;)V
      intermediary method_37035 Lnet/minecraft/class_6382;method_37035(Lnet/minecraft/class_6381;[Lnet/minecraft/class_2561;)V
      official a Lflc;a(Lflb;[Lxp;)V
    • put

      void put(NarrationPart part, Narration<?> narration)
      Adds a narration to this message builder.

      If a narration already exists for the specified narration part, it is replaced by the new narration.

      See Also:
      Mappings:
      Namespace Name Mixin selector
      named put Lnet/minecraft/client/gui/screen/narration/NarrationMessageBuilder;put(Lnet/minecraft/client/gui/screen/narration/NarrationPart;Lnet/minecraft/client/gui/screen/narration/Narration;)V
      intermediary method_37032 Lnet/minecraft/class_6382;method_37032(Lnet/minecraft/class_6381;Lnet/minecraft/class_6384;)V
      official a Lflc;a(Lflb;Lfle;)V
    • nextMessage

      Creates a narration message builder for a submessage.

      Submessages can have their own set of narrations for the narration parts, which are merged with the "parent" message's narrations as described above.

      Returns:
      the created builder
      API Note:
      All returned builder instances are equivalent and refer to the same submessage. If you want to add yet another set of narrations, call this method again on the first submessage builder to obtain a "nested" submessage builder.
      Mappings:
      Namespace Name Mixin selector
      named nextMessage Lnet/minecraft/client/gui/screen/narration/NarrationMessageBuilder;nextMessage()Lnet/minecraft/client/gui/screen/narration/NarrationMessageBuilder;
      intermediary method_37031 Lnet/minecraft/class_6382;method_37031()Lnet/minecraft/class_6382;
      official a Lflc;a()Lflc;