-
Notifications
You must be signed in to change notification settings - Fork 3
Functions
PandawanFr edited this page Aug 7, 2017
·
4 revisions
Functions are a way to contain the code and commands which need to be put in a .mcfunction
file. In short, they tell mcs
what file to create and are required for mcs
to compile correctly.
If you want to use JavaScript-like functions, check out Macros.
To declare a function, you use the function
keyword, followed by the function's name
and curly brackets ({
and }
).
Example:
function myFunction {
};
You can add all your function and command logic inside the curly brackets ({
and }
).
Since function blocks simply compile into .mcfunction
files, you can call them like you would in Minecraft.
Example:
function myNamespace:myFunction;