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 ConstantDescription -
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.boolean
For internal usage.void
updateComponent
(MessageComponent component, String param) Applies style of this chat code to given component.static SkriptChatCode
Returns 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:ChatCode
Checks if this chat code takes a string parameter. If yes, scripters will use it like:<name:param>
-
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 interfaceChatCode
- Returns:
- Color code.
-
getLangName
Description copied from interface:ChatCode
Name to be used in scripts. ifChatCode.isLocalized()
is true, this is used as a language file key instead.- Specified by:
getLangName
in interfaceChatCode
- Returns:
- Name in language file.
-
isLocalized
public boolean isLocalized()Description copied from interface:ChatCode
For internal usage.- Specified by:
isLocalized
in interfaceChatCode
- 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 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:
getColorChar
in interfaceChatCode
- Returns:
- Color char.
-
updateComponent
Description copied from interface:ChatCode
Applies style of this chat code to given component.- Specified by:
updateComponent
in interfaceChatCode
- Parameters:
component
- Component to update.param
- String parameter. May be empty string.
-