Enum Class SkriptChatCode

java.lang.Object
java.lang.Enum<SkriptChatCode>
ch.njol.skript.util.chat.SkriptChatCode
All Implemented Interfaces:
ChatCode, Serializable, Comparable<SkriptChatCode>, Constable

public enum SkriptChatCode extends Enum<SkriptChatCode> implements ChatCode
Chat codes that come with Skript by default.
  • Enum Constant Details

  • Method Details

    • values

      public static SkriptChatCode[] 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 SkriptChatCode 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
    • hasParam

      public boolean hasParam()
      Description copied from interface: ChatCode
      Checks if this chat code takes a string parameter. If yes, scripters will use it like: <name:param>
      Specified by:
      hasParam in interface ChatCode
      Returns:
    • getColorCode

      public @Nullable String getColorCode()
      Description copied from interface: ChatCode
      Gets color code of this chat code. Skript will apply it automatically. Note that setting color code is usually not useful for addon developers, because Skript supports all colors that Minecraft client does.

      If null is returned, ChatCode.updateComponent(MessageComponent, String) is called instead. You probably want that, as it is more versatile.

      Specified by:
      getColorCode in interface ChatCode
      Returns:
      Color code.
    • getLangName

      public @Nullable String getLangName()
      Description copied from interface: ChatCode
      Name to be used in scripts. if ChatCode.isLocalized() is true, this is used as a language file key instead.
      Specified by:
      getLangName in interface ChatCode
      Returns:
      Name in language file.
    • isLocalized

      public boolean isLocalized()
      Description copied from interface: ChatCode
      For internal usage.
      Specified by:
      isLocalized in interface ChatCode
      Returns:
      True for Skript's color codes.
    • getColorChar

      public char getColorChar()
      Description copied from interface: ChatCode
      Gets the color char that is an alternative way to use this chat code. Return 0 unless you wish to use a color char.

      If not 0, it can be used in scripts in following way: &x or §x, if the code is x. It is not case sensitive if you return a character from which there is upper case character available. If you return the upper case character, lower case variant cannot be used in scripts (so don't do that).

      Specified by:
      getColorChar in interface ChatCode
      Returns:
      Color char.
    • updateComponent

      public void updateComponent(MessageComponent component, String param)
      Description copied from interface: ChatCode
      Applies style of this chat code to given component.
      Specified by:
      updateComponent in interface ChatCode
      Parameters:
      component - Component to update.
      param - String parameter. May be empty string.