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)

10 = 10 ticks = 0.5 seconds

t

Ticks

10t = 10 ticks = 0.5 seconds

s

Seconds

5s = 5 seconds = 100 ticks

m

Minutes

2m = 2 minutes

h

Hours

1h = 1 hour

d

Days

1d = 1 day

w

Weeks

1w = 1 week

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 "

"He said \"hello\""

\\

Literal \

"path\\to\\file"

\{\{

Literal {{

"Use \{\{ for interpolation"

\}\}

Literal }}

"End with \}\}"

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

&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

Formatting codes:

Code

Effect

&#9AFFD1

Specified RGB hex color

&k

Obfuscated (random characters)

&l

Bold

&m

Strikethrough

&n

Underline

&o

Italic

&r

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

42, -7, 0

Long

Number with L suffix

42L, -7L

Float

Decimal number

3.14, -0.5, 1.0

Double

Number with D suffix

3.14D, 1D

Boolean

true or false

true, false

String

Text in quotes

"hello", "world"

List

Type[elements]

Int[1, 2, 3]