Enum Class Message

java.lang.Object
java.lang.Enum<Message>
me.despical.commandframework.Message
All Implemented Interfaces:
Serializable, Comparable<Message>, Constable

public enum Message extends Enum<Message>
Author:
Despical

Created at 18.07.2024

  • Enum Constant Details

    • SHORT_ARG_SIZE

      public static final Message SHORT_ARG_SIZE
    • LONG_ARG_SIZE

      public static final Message LONG_ARG_SIZE
    • ONLY_BY_PLAYERS

      public static final Message ONLY_BY_PLAYERS
    • ONLY_BY_CONSOLE

      public static final Message ONLY_BY_CONSOLE
    • NO_PERMISSION

      public static final Message NO_PERMISSION
    • MUST_HAVE_OP

      public static final Message MUST_HAVE_OP
    • WAIT_BEFORE_USING_AGAIN

      public static final Message WAIT_BEFORE_USING_AGAIN
  • Method Details

    • values

      public static Message[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Message valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • setColorFormatter

      public static void setColorFormatter(@NotNull @NotNull Function<String,String> colorFormatter)
      For instance, can be used to translate Minecraft color and Hex color codes.
      Parameters:
      colorFormatter - the function that will be applied to the strings to colorize
    • setMessage

      public void setMessage(BiFunction<Command,CommandArguments,Boolean> message)
      Set a custom error message.
      Parameters:
      message - the custom error message.