Class MessageUtil


  • public final class MessageUtil
    extends Object
    Message utility methods
    • Method Detail

      • format

        @NotNull
        public static @NotNull String format​(@NotNull
                                             @NotNull String message,
                                             @NotNull
                                             @NotNull String... replacements)
        Format a string. Replacements come in pairs of two, where the first value is the string to be replaced, and the second value is the replacement, example: %key1%, value1, %key2%, value2
        Parameters:
        message - String to format
        replacements - Replacements, needs to be a multiple of 2
        Returns:
        The formatted string
      • sendMessage

        public static void sendMessage​(@NotNull
                                       @NotNull org.bukkit.command.CommandSender recipient,
                                       @NotNull
                                       @NotNull Message message,
                                       @NotNull
                                       @NotNull String... replacements)
        Send a message to a recipient
        Parameters:
        recipient - Receiver of the message
        message - Message to send
        replacements - Replacements
        See Also:
        for information about string replacements