Package ch.njol.skript.util.chat
Interface ChatCode
- All Known Implementing Classes:
SkriptChatCode
public interface ChatCode
-
Method Summary
Modifier and TypeMethodDescriptionchar
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
hasParam()
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
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. ifisLocalized()
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 isx
. 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.
-