Class MessageUtil

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

      • format

        public static @NotNull String format​(@NotNull
                                             @NotNull String message,
                                             @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
        message - String to format
        replacements - Replacements, needs to be a multiple of 2
        The formatted string
      • sendMessage

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