Getting Started
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
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
Terminal window iex (iwr "https://raw.githubusercontent.com/moritz-hoelting/shulkerscript-cli/main/install.ps1").ContentOpen a bash terminal and run
Terminal window curl -sfSL https://raw.githubusercontent.com/moritz-hoelting/shulkerscript-cli/main/install.sh | bash - Test the installation by running
Terminal window shulkerscript --version
Download with cargo-binstall
- Make sure you have cargo-binstall installed. If not, follow the installation instructions.
- Run
Terminal window cargo-binstall --git https://github.com/moritz-hoelting/shulkerscript-cli shulkerscript-cli - Test the installation by running
Terminal window shulkerscript --version
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.
Terminal window shulkerscript --version
Building from source
- Make sure you have Rust and Cargo installed.
- Install the CLI by running
Terminal window cargo install --git https://github.com/moritz-hoelting/shulkerscript-cli - Test the installation by running
Terminal window shulkerscript --version
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.
Terminal window shulkerscript init - 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:
namespace "your-name";
#[tick]fn main() { /say Hello, world!}
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
Terminal window shulkerscript builddist
directory. - Alternatively you can run
to automatically rebuild the project when a file changes.
Terminal window shulkerscript watch
Distributing the project
- Navigate into the project directory.
- Run
This will create a ZIP archive containing the compiled project.
Terminal window shulkerscript build --zip - You can now distribute the archive to your users.