Interface MessageDecorator

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface MessageDecorator
Message decorator decorates the chat messages and other messages server-side. Currently, only one message decorator can exist at a time. The message decorator that is currently used can be obtained by MinecraftServer.getMessageDecorator().

For the message decorator to produce a signed message, both the server and the sender's client need to have chat previews enabled, Otherwise, the decorated content is considered unsigned, and if the clients require chat messages to be signed via the "Only Show Secure Chat" option, they will see the undecorated message. Therefore, message decorator is not recommended for censoring messages.

Message decorator results are cached, allowing non-pure decorators (i.e. ones affected by externally controlled variables) without affecting the signature verification process. Note that the decorator can still run during message submission to decorate filtered parts of the message.

Mappings:
Namespace Name
official rh
intermediary net/minecraft/class_7492
named net/minecraft/network/message/MessageDecorator
  • Field Details

    • NOOP

      static final MessageDecorator NOOP
      An empty message decorator that returns the original message.
      Mappings:
      Namespace Name Mixin selector
      official a Lrh;a:Lrh;
      intermediary field_39384 Lnet/minecraft/class_7492;field_39384:Lnet/minecraft/class_7492;
      named NOOP Lnet/minecraft/network/message/MessageDecorator;NOOP:Lnet/minecraft/network/message/MessageDecorator;
  • Method Details

    • decorate

      Returns the decorated message.
      Parameters:
      sender - the player who sent the message, or null if message was not sent by a player
      Returns:
      the decorated message
      Mappings:
      Namespace Name Mixin selector
      official decorate Lrh;decorate(Lagh;Lrq;)Ljava/util/concurrent/CompletableFuture;
      intermediary decorate Lnet/minecraft/class_7492;decorate(Lnet/minecraft/class_3222;Lnet/minecraft/class_2561;)Ljava/util/concurrent/CompletableFuture;
      named decorate Lnet/minecraft/network/message/MessageDecorator;decorate(Lnet/minecraft/server/network/ServerPlayerEntity;Lnet/minecraft/text/Text;)Ljava/util/concurrent/CompletableFuture;
    • decorate

      Mappings:
      Namespace Name Mixin selector
      official decorate Lrh;decorate(Lagh;Lsd;)Ljava/util/concurrent/CompletableFuture;
      intermediary decorate Lnet/minecraft/class_7492;decorate(Lnet/minecraft/class_3222;Lnet/minecraft/class_7471;)Ljava/util/concurrent/CompletableFuture;
      named decorate Lnet/minecraft/network/message/MessageDecorator;decorate(Lnet/minecraft/server/network/ServerPlayerEntity;Lnet/minecraft/network/message/SignedMessage;)Ljava/util/concurrent/CompletableFuture;
    • attachIfNotDecorated

      static SignedMessage attachIfNotDecorated(SignedMessage message, Text attached)
      Mappings:
      Namespace Name Mixin selector
      official attachIfNotDecorated Lrh;attachIfNotDecorated(Lsd;Lrq;)Lsd;
      intermediary attachIfNotDecorated Lnet/minecraft/class_7492;attachIfNotDecorated(Lnet/minecraft/class_7471;Lnet/minecraft/class_2561;)Lnet/minecraft/class_7471;
      named attachIfNotDecorated Lnet/minecraft/network/message/MessageDecorator;attachIfNotDecorated(Lnet/minecraft/network/message/SignedMessage;Lnet/minecraft/text/Text;)Lnet/minecraft/network/message/SignedMessage;