9.5. General Notes
Useful reference information for MSC scripting.
9.5.1. Time Syntax
Many operators and functions accept time parameters using this format:
Suffix |
Unit |
Example |
|---|---|---|
(none) |
Ticks (1/20 second) |
|
|
Ticks |
|
|
Seconds |
|
|
Minutes |
|
|
Hours |
|
|
Days |
|
|
Weeks |
|
Used with: @delay, @cooldown, @global_cooldown, @prompt, and @chatscript. See Scripts for details on these operators.
9.5.2. Escape Sequences
Within string literals ("..."), use backslash to escape special characters:
Sequence |
Result |
Example |
|---|---|---|
|
Literal |
|
|
Literal |
|
|
Literal |
|
|
Literal |
|
9.5.3. String Interpolation
Use {{ }} inside strings to embed expressions (see Expressions for more details):
@player Hello, {{player.getName()}}! You have {{score}} points.
The expression result is automatically converted to a String.
9.5.4. Color Codes
Use & followed by a code in @player messages:
Code |
Color |
Code |
Color |
|---|---|---|---|
|
Black |
|
Dark Gray |
|
Dark Blue |
|
Blue |
|
Dark Green |
|
Green |
|
Dark Aqua |
|
Aqua |
|
Dark Red |
|
Red |
|
Dark Purple |
|
Light Purple |
|
Gold |
|
Yellow |
|
Gray |
|
White |
Formatting codes:
Code |
Effect |
|---|---|
|
Specified RGB hex color |
|
Obfuscated (random characters) |
|
Bold |
|
Strikethrough |
|
Underline |
|
Italic |
|
Reset (clear all formatting) |
0 = Black 8 = Dark Gray
1 = Dark Blue 9 = Blue
2 = Dark Green a = Green
3 = Dark Aqua b = Aqua
4 = Dark Red c = Red
5 = Dark Purple d = Light Purple
6 = Gold e = Yellow
7 = Gray f = White
Normal, Bold, Underline, Italic
9.5.5. Naming Conventions
Variables: lowercase, underscores allowed (
score,player_count)Types: PascalCase, start with uppercase (
Player,BlockLocation)Namespaces: lowercase, underscores allowed (
mymap,my_namespace)Functions: camelCase or lowercase, underscores allowed (
getPlayer,sqrt)
Names can generally contain letters, numbers, and underscores (_). They must start with an uppercase letter (for types) or a lowercase letter (for anything else).
9.5.6. Type Literals
Type |
Literal syntax |
Examples |
|---|---|---|
Int |
Whole number |
|
Long |
Number with |
|
Float |
Decimal number |
|
Double |
Number with |
|
Boolean |
|
|
String |
Text in quotes |
|
List |
|
|