Converting to ByteSkript
A short guide for converting code from SkriptLang's original Skript to the language format used by ByteSkript. This also contains a list of the major differences between the two.
While an effort has been made to maintain some (superficial) parity, ByteSkript's language implementation is not compatible with SkriptLang's version (original Skript.)
Some of these differences are changes to the appearance or format of the Skript language. Others are functional changes to the behaviour of certain elements.
The main differences (and how to convert to ByteSkript's format) are listed on this page.

Triggers

Description

All code-containing elements require a trigger: section in ByteSkript. This includes events, functions, etc.
All of the runnable code goes inside this trigger: entry.

Comparison

ByteSkript Format
SkriptLang Format
1
on script load:
2
trigger:
3
print "hello"
4
โ€‹
5
function myFunc():
6
trigger:
7
print "hello"
Copied!
1
on script load:
2
broadcast "hello"
3
โ€‹
4
function myFunc():
5
broadcast "hello"
Copied!

Change Reason

ByteSkript supports other entries in these members, as well as the runnable trigger.
For example, the function supports a verify: entry for start-up testing.

Minecraft Syntax

Description

Unlike original Skript, ByteSkript is not a Minecraft/Bukkit domain-specific language.
ByteSkript provides no Minecraft-related syntax. ByteSkript is not a Bukkit server plug-in.
Third-party language libraries or modified versions may offer Minecraft support.

Change Reason

ByteSkript's design philosophy is to be a simple, serviceable scripting language for the Java Virtual Machine.

Variables

Description

ByteSkript's regular {var} variables are local to the current trigger. This is comparable to original Skript's {_local} variables.
ByteSkript's variables are strictly-named and do not support inputs in their names.
ByteSkript has multiple variable types with special use-cases.

Comparison

ByteSkript Format
SkriptLang Format
1
set {!var} to true // global, in all places
2
set {var} to true // local to this trigger
3
set {@var} to true // atomic, can be passed to other triggers
4
set {_var} to true // thread-local, anywhere on this process
Copied!
1
set {var} to true # global, accessible anywhere
2
set {_var} to true # local, accessible in this trigger
Copied!

Change Reason

Original Skript's variables were not easily-applicable to the JVM environment, and would have made ByteSkript significantly slower than other JVM languages.
ByteSkript still supports a similar form with {!var} global variables.
See the variables page for examples.

Lists

Description

ByteSkript does not support original Skript's {list::*} variables. Instead, regular variables can be set to list objects.

Comparison

ByteSkript Format
SkriptLang Format
1
set {list} to a new list
2
add "hello" to {list}
3
add "goodbye" to {list}
4
set index 1 in {list} to "there"
5
clear {list}
Copied!
1
add "hello" to {list::*}
2
add "goodbye" to {list::*}
3
set {list::2} to "there"
4
clear {list::*}
Copied!

Change Reason

Original Skript's list variables were not easily-applicable to the JVM environment, and would have made ByteSkript significantly slower than other JVM languages.
Some beginners found the nested list/map structure of original Skript unnecessarily confusing, and ByteSkript's more explicit version should make this clearer.

Loops

Description

ByteSkript has a slightly different loop syntax that is designed to be clearer and simpler to use.

Comparison

ByteSkript Format
SkriptLang Format
1
set {list} to a new list
2
add "hello" to {list}
3
add "goodbye" to {list}
4
loop {word} in {list}:
5
print {word}
6
โ€‹
7
loop 5 times:
8
print "hello"
Copied!
1
add "hello" to {list::*}
2
add "goodbye" to {list::*}
3
loop {list::*}:
4
broadcast loop-value
5
โ€‹
6
loop 5 times:
7
broadcast "hello"
Copied!

Change Reason

This was changed along with lists to be clearer and easier to understand for beginners.

Function Declarations/Calls

Description

ByteSkript has some minor changes to function declarations and calls.

Comparison

ByteSkript Format
SkriptLang Format
1
function no_args_func: // no () required here
2
trigger:
3
print "hello"
4
run normal_func("hi") // 'run' effect required
5
โ€‹
6
function normal_func (thing): // no parameter types specified
7
trigger:
8
print {thing}
Copied!
1
function no_args_func():
2
broadcast "hello"
3
normal_func("hi")
4
โ€‹
5
function normal_func(thing: string):
6
trigger:
7
broadcast {thing}
Copied!

Change Reason

Part of making ByteSkript's language stricter and more regular meant making sure every line was explicitly an effect, and not an expression. This meant the myFunction() dual effect/expression from original Skript had to be altered.
The run %Executable% effect is also used for running other things such as lambdas, dynamic functions and background tasks.