Package ch.njol.skript.util.chat
Enum Class SkriptChatCode
- All Implemented Interfaces:
ChatCode,Serializable,Comparable<SkriptChatCode>,Constable
Chat codes that come with Skript by default.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptioncharGets the color char that is an alternative way to use this chat code.@Nullable StringGets color code of this chat code.@Nullable StringName to be used in scripts.booleanhasParam()Checks if this chat code takes a string parameter.booleanFor internal usage.voidupdateComponent(MessageComponent component, String param) Applies style of this chat code to given component.static SkriptChatCodeReturns the enum constant of this class with the specified name.static SkriptChatCode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
reset
-
black
-
dark_blue
-
dark_green
-
dark_aqua
-
dark_red
-
dark_purple
-
gold
-
gray
-
dark_gray
-
blue
-
green
-
aqua
-
red
-
light_purple
-
yellow
-
white
-
bold
-
italic
-
underlined
-
strikethrough
-
obfuscated
-
open_url
-
run_command
-
suggest_command
-
change_page
-
copy_to_clipboard
-
show_text
-
font
-
insertion
-
translate
-
keybind
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
hasParam
public boolean hasParam()Description copied from interface:ChatCodeChecks if this chat code takes a string parameter. If yes, scripters will use it like:<name:param> -
getColorCode
Description copied from interface:ChatCodeGets 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:
getColorCodein interfaceChatCode- Returns:
- Color code.
-
getLangName
Description copied from interface:ChatCodeName to be used in scripts. ifChatCode.isLocalized()is true, this is used as a language file key instead.- Specified by:
getLangNamein interfaceChatCode- Returns:
- Name in language file.
-
isLocalized
public boolean isLocalized()Description copied from interface:ChatCodeFor internal usage.- Specified by:
isLocalizedin interfaceChatCode- Returns:
- True for Skript's color codes.
-
getColorChar
public char getColorChar()Description copied from interface:ChatCodeGets 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:
&xor§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).- Specified by:
getColorCharin interfaceChatCode- Returns:
- Color char.
-
updateComponent
Description copied from interface:ChatCodeApplies style of this chat code to given component.- Specified by:
updateComponentin interfaceChatCode- Parameters:
component- Component to update.param- String parameter. May be empty string.
-