Getting Started
Installation
To get started with Shulkerscript, you need to install the Shulkerscript CLI. You can either download the latest release from the GitHub releases page or build it from source.
Quickinstall script (recommended)
-
Open a PowerShell terminal and run
Open a bash terminal and run
- Test the installation by running
Download with cargo-binstall
- Make sure you have cargo-binstall installed. If not, follow the installation instructions.
- Run
- Test the installation by running
Download from GitHub
- Go to the GitHub releases page and download the latest release for your platform.
- Extract the downloaded archive.
- Move the extracted binary to a directory in your PATH (required for the CLI to be accessible from anywhere).
- Test the installation by running You should see the version of the CLI printed to the console.
Building from source
- Make sure you have Rust and Cargo installed.
- Install the CLI by running
- Test the installation by running
Installing the VS Code extension (optional)
To get syntax highlighting and snippets for Shulkerscript files in Visual Studio Code, you can install the official extension.
Creating a new project
- Create a new directory for your project.
- Navigate into the directory.
- Run This will create a new Shulkerscript project in the current directory.
- Open the
pack.toml
file in your favorite text editor and configure the project to your liking.
The project structure should look like this:
Directorysrc/
- main.shu
- .gitignore
- pack.toml
- pack.png
Writing your first script
After opening the file src/main.shu
in your favorite text editor, you should see the following content:
The annotation #[tick]
tells the compiler that this function should be executed every tick.
Every line that starts with a /
is a command that will included in the output. You can add as many commands as you like.
To begin with, you can change the message in the /say
command to something else.
Building the project
- Navigate into the project directory.
- Run
This will compile the project and output the result to the
dist
directory. - Alternatively you can run to automatically rebuild the project when a file changes.
Distributing the project
- Navigate into the project directory.
- Run This will create a ZIP archive containing the compiled project.
- You can now distribute the archive to your users.