Literals
Data values directly written in the script source code.
Any value written into the script source itself is a literal.
A literal is an absolute value stored in the code itself, rather than extracted from some expression during the program run-time.
Some expressions act as literals by writing a raw value into the compiled source code, but are not included in this section.
Boolean
Booleans are the true/false value-types.
The two boolean literals are true
and false
.
Occasionally, booleans can be exchanged with other types. The true
and false
values can be equated with 1
and 0
in some syntax.
For some boolean comparisons, null
will count as a false
value.
String
Strings are the most common text value-type.
Strings are written inside "<text>"
double-quotes.
Strings do not support parsed inputs. Instead, they may be joined with the +
operator.
This is different from original Skript. A simple comparison is given below, for users that need help converting scripts to this format.
"hello " + {name}
"hello %{name}%"
"hello " + my_func() + " there"
"hello %my_func()% there"
newline + ":)"
"%newline%:)"
Integer
Integers are whole (non-decimal) numbers.
Integers are written directly in standard 0-9
numerals.
Integers are between -2147483648
and 2147483647
. If you need a smaller or larger value, use a long.
Double
Doubles are decimal numbers.
Doubles are written directly in standard 0-9
numerals. Almost all decimals should be handled as double form.
Long
Longs are whole (non-decimal) numbers.
Longs are written directly in standard 0-9
numerals with the L
suffix. Longs have a much greater limit than integers, but take up twice the space in memory.
Float
Floats are smaller, less-precise decimal numbers.
Floats are written directly in standard 0-9
numerals with the F
suffix. Floats take up less space in memory than doubles, but support fewer decimal places.
RegEx
Regular expressions are a standard form of text-matching pattern.
RegEx is written inside /pattern/
slash-characters. A /
character inside the pattern must be escaped with a backslash \
.
Be careful! A double //
marks a line-comment!
Null
The null
value is an empty value, used when a variable or expression has no value.
The null
value is equal to other null
values (all null values are the same - nothing.)
Last updated