Interface ChatCode

All Known Implementing Classes:
SkriptChatCode

public interface ChatCode
Chat codes; includes color codes (reference) and also, some formatting codes (mostly this)
  • Method Summary

    Modifier and Type
    Method
    Description
    char
    Gets the color char that is an alternative way to use this chat code.
    @Nullable String
    Gets color code of this chat code.
    @Nullable String
    Name to be used in scripts.
    boolean
    Checks if this chat code takes a string parameter.
    default boolean
    For internal usage.
    void
    updateComponent​(MessageComponent component, String param)
    Applies style of this chat code to given component.
  • Method Details

    • updateComponent

      void updateComponent(MessageComponent component, String param)
      Applies style of this chat code to given component.
      Parameters:
      component - Component to update.
      param - String parameter. May be empty string.
    • hasParam

      boolean hasParam()
      Checks if this chat code takes a string parameter. If yes, scripters will use it like: <name:param>
      Returns:
    • getColorCode

      @Nullable String getColorCode()
      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, updateComponent(MessageComponent, String) is called instead. You probably want that, as it is more versatile.

      Returns:
      Color code.
    • getLangName

      @Nullable String getLangName()
      Name to be used in scripts. if isLocalized() is true, this is used as a language file key instead.
      Returns:
      Name in language file.
    • isLocalized

      default boolean isLocalized()
      For internal usage.
      Returns:
      True for Skript's color codes.
    • getColorChar

      char getColorChar()
      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).

      Returns:
      Color char.