Change capitalization of Shulkerscript
This commit is contained in:
parent
b8b1a4abe8
commit
685830200a
|
@ -1,5 +1,5 @@
|
|||
# Documentation for ShulkerScript
|
||||
This is the documentation for ShulkerScript. It is a work in progress and will be updated as the language evolves.
|
||||
# Documentation for Shulkerscript
|
||||
This is the documentation for Shulkerscript. It is a work in progress and will be updated as the language evolves.
|
||||
|
||||
## Getting Started
|
||||
This documentation is created using Astro and Starlight. To get started, you need to install the dependencies and start the development server.
|
||||
|
|
|
@ -8,10 +8,10 @@ export default defineConfig({
|
|||
site: "https://shulkerscript.hoelting.dev",
|
||||
integrations: [
|
||||
starlight({
|
||||
title: 'ShulkerScript',
|
||||
title: 'Shulkerscript',
|
||||
logo: {
|
||||
src: './src/assets/logo.webp',
|
||||
alt: 'ShulkerScript Logo',
|
||||
alt: 'Shulkerscript Logo',
|
||||
},
|
||||
favicon: '/favicon.ico',
|
||||
description: 'A simple and powerful scripting language for Minecraft datapacks.',
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/check": "^0.9.3",
|
||||
"@astrojs/starlight": "^0.26.1",
|
||||
"astro": "^4.14.3",
|
||||
"@astrojs/starlight": "^0.28.2",
|
||||
"astro": "^4.15.9",
|
||||
"sharp": "^0.33.5",
|
||||
"shiki": "^1.14.1",
|
||||
"starlight-links-validator": "^0.10.1",
|
||||
"starlight-links-validator": "^0.12.1",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"packageManager": "pnpm@9.7.0+"
|
||||
|
|
6466
pnpm-lock.yaml
6466
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
title: Wilkommen bei der ShulkerScript Dokumentation
|
||||
title: Wilkommen bei der Shulkerscript Dokumentation
|
||||
description: Eine einfache und leistungsstarke Sprache für Minecraft Datapacks
|
||||
template: splash
|
||||
hero:
|
||||
tagline: Einführung in ShulkerScript
|
||||
tagline: Einführung in Shulkerscript
|
||||
image:
|
||||
file: ../../../assets/logo.webp
|
||||
actions:
|
||||
|
@ -26,10 +26,10 @@ import { Card, CardGrid } from '@astrojs/starlight/components';
|
|||
</Card>
|
||||
<Card title="Unkomplizierte Functions" icon="add-document">
|
||||
Mehrere Funktionsdateien aus einer einzigen Quelldatei generieren und sie
|
||||
von Minecraft oder anderen ShulkerScript-Dateien aus aufrufen.
|
||||
von Minecraft oder anderen Shulkerscript-Dateien aus aufrufen.
|
||||
</Card>
|
||||
<Card title="In Rust geschrieben" icon="seti:rust">
|
||||
Die ShulkerScript-Compiler sind in Rust geschrieben, was für eine hohe Geschwindigkeit und Sicherheit sorgt.
|
||||
Der Shulkerscript-Compiler ist in Rust geschrieben, was für eine hohe Geschwindigkeit und Sicherheit sorgt.
|
||||
</Card>
|
||||
<Card title="Zum Projekt beitragen" icon="github">
|
||||
Zu [dem CLI](https://github.com/moritz-hoelting/shulkerscript-cli) oder [dem Compiler](https://github.com/moritz-hoelting/shulkerscript-lang) beitragen.
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
---
|
||||
title: Kommandozeilen-Interface Referenz
|
||||
description: Referenz für das ShulkerScript Kommandozeilen-Tool
|
||||
description: Referenz für das Shulkerscript Kommandozeilen-Tool
|
||||
sidebar:
|
||||
label: CLI
|
||||
---
|
||||
|
||||
Das ShulkerScript CLI ist ein Kommandozeilen-Tool zum Verwalten von ShulkerScript-Projekten.
|
||||
Das Shulkerscript CLI ist ein Kommandozeilen-Tool zum Verwalten von Shulkerscript-Projekten.
|
||||
|
||||
|
||||
## init
|
||||
|
@ -21,17 +21,50 @@ Optionen:
|
|||
- `--name`: Der Name des Projekts. Standardmäßig der Name des Verzeichnisses.
|
||||
- `--description`: Die Beschreibung des Projekts.
|
||||
- `--pack-format`: Das Format des Packs. Standardmäßig `26`.
|
||||
- `--icon`: Pfad zu der Icon-Datei. Für das Standard-Icon leer lassen.
|
||||
- `--batch`: Keine fehlenden Daten durch Eingaben anfordern, Standardwerte verwenden oder fehlschlagen.
|
||||
- `--vcs`: Das gewünschte Versionskontrollsystem. Standardmäßig `git`.
|
||||
|
||||
## build
|
||||
Baut das Projekt im angegebenen Pfad in das `dist`-Verzeichnis.
|
||||
```bash
|
||||
shulkerscript build [PATH]
|
||||
shulkerscript build [OPTIONS] [PATH]
|
||||
```
|
||||
- `PATH`: Der Pfad zum Verzeichnis, in dem sich das Projekt befindet. Standardmäßig das aktuelle Verzeichnis.
|
||||
|
||||
## package
|
||||
Baut und verpackt das Projekt im angegebenen Pfad in eine `.zip`-Datei.
|
||||
Optionen:
|
||||
- `--assets <ASSETS>` Pfad zum Assets-Ordner [Standard: `./assets`]
|
||||
- `--output <OUTPUT>` Ausgabe-Ordner, überschreibt die `DATAPACK_DIR` Umgebungsvariable
|
||||
- `--no-validate` Validierung des Pack-Formats überspringen
|
||||
- `--zip` Verpackt die Ausgabe in eine Zip-Datei
|
||||
|
||||
Umgebungsvariablen:
|
||||
- `DATAPACK_DIR` Ausgabe-Ordner [Standard: `./dist`]
|
||||
|
||||
## watch
|
||||
```bash
|
||||
shulkerscript build --zip [PATH]
|
||||
shulkerscript watch [OPTIONS] [PATH]
|
||||
```
|
||||
- `PATH`: Pfad des zu beobachtenden Ordners [Standard: `.`]
|
||||
|
||||
Optionen:
|
||||
- `--no-initial` Den Befehl nicht initial ausführen
|
||||
- `--debounce-time <DEBOUNCE_TIME>` Die zu wartende Zeit in ms nach der letzten Änderung bevor der Befehl erneut ausgeführt wird [default: `2000`]
|
||||
- `--execute <COMMAND>` Die Shulkerscript Befehle, die im Projekt ausgeführt werden sollen, wenn Änderungen erkannt wurden [Mehrfach-Argument, Standard: `build .`]
|
||||
- `--no-execute` Keine vordefinierten Shulkerscript Befehle ausführen
|
||||
- `--shell` Die Shell-Befehle, die im Projekt ausgeführt werden sollen, wenn Änderungen erkannt wurden [Mehrfach-Argument]
|
||||
|
||||
## clean
|
||||
Reinigt das Ausgabeverzeichnis des Projekts im angegebenen Pfad.
|
||||
```bash
|
||||
shulkerscript clean [OPTIONS] [PATH]
|
||||
```
|
||||
- `PATH`: Der Pfad des Projektordners, der gereinigt werden soll [Standard: `.`]
|
||||
|
||||
Optionen:
|
||||
- `--output <OUTPUT>` Der Ausgabeordner, überschreibt die `DATAPACK_DIR` Umgebungsvariable
|
||||
- `--all` Löscht alle Dateien im Ausgabeverzeichnis, auch wenn sie nicht vom Projekt stammen
|
||||
- `--force` Notwendig für `--all`, um das Löschen aller Dateien zu bestätigen
|
||||
|
||||
Umgebungsvariablen:
|
||||
- `DATAPACK_DIR` Der Ausgabeordner [Standard: `./dist`]
|
|
@ -1,12 +1,12 @@
|
|||
---
|
||||
title: Differences to other languages
|
||||
description: See how ShulkerScript compares to similar languages.
|
||||
description: See how Shulkerscript compares to similar languages.
|
||||
---
|
||||
|
||||
import { Tabs, TabItem, Aside } from "@astrojs/starlight/components";
|
||||
import SplitView from "@components/SplitView.astro";
|
||||
|
||||
This page will highlight the differences of ShulkerScript and vanilla mcfunction and mcscript.
|
||||
This page will highlight the differences of Shulkerscript and vanilla mcfunction and mcscript.
|
||||
|
||||
:::note[Credits to mcscript]
|
||||
I came into contact with [mcscript](https://mcscript.stevertus.com/) by Stevertus a few years ago. I wrote some datapacks
|
||||
|
@ -17,12 +17,12 @@ under active development anymore. If you are interested, check out his new proje
|
|||
|
||||
## Functions
|
||||
|
||||
The first difference you can see is that ShulkerScript takes a much different approach to functions than mcfunction and mcscript.
|
||||
The first difference you can see is that Shulkerscript takes a much different approach to functions than mcfunction and mcscript.
|
||||
The following example declares two functions and calls them second from the first one.
|
||||
|
||||
<SplitView gap="10px">
|
||||
<Tabs slot="left">
|
||||
<TabItem label="ShulkerScript">
|
||||
<TabItem label="Shulkerscript">
|
||||
```shulkerscript
|
||||
// functions.shu
|
||||
#[load]
|
||||
|
@ -71,11 +71,11 @@ The following example declares two functions and calls them second from the firs
|
|||
|
||||
## Comments
|
||||
|
||||
Comments can be expressed differently in all three languages. ShulkerScript uses `//` for single-line comments and `/* */` for multi-line comments.
|
||||
Comments can be expressed differently in all three languages. Shulkerscript uses `//` for single-line comments and `/* */` for multi-line comments.
|
||||
|
||||
<SplitView gap="10px">
|
||||
<Tabs slot="left">
|
||||
<TabItem label="ShulkerScript">
|
||||
<TabItem label="Shulkerscript">
|
||||
```shulkerscript
|
||||
// comments.shu
|
||||
// this is a comment
|
||||
|
@ -116,11 +116,11 @@ Comments can be expressed differently in all three languages. ShulkerScript uses
|
|||
|
||||
## Execute Command
|
||||
|
||||
Both ShulkerScript and mcfunction offer an easier way for using execute commands, as they are common when building datapacks.
|
||||
Both Shulkerscript and mcfunction offer an easier way for using execute commands, as they are common when building datapacks.
|
||||
|
||||
<SplitView gap="10px">
|
||||
<Tabs slot="left">
|
||||
<TabItem label="ShulkerScript">
|
||||
<TabItem label="Shulkerscript">
|
||||
```shulkerscript
|
||||
// execute.shu
|
||||
fn execute() {
|
||||
|
@ -150,16 +150,16 @@ Both ShulkerScript and mcfunction offer an easier way for using execute commands
|
|||
</SplitView>
|
||||
|
||||
:::tip
|
||||
ShulkerScript and mcscript each offer a shortcut for `as(...), at("@s")`, which is `asat(@a)`.
|
||||
Shulkerscript and mcscript each offer a shortcut for `as(...), at("@s")`, which is `asat(@a)`.
|
||||
:::
|
||||
|
||||
## If-Else Statements
|
||||
|
||||
ShulkerScript and mcscript offer a more convenient way to write if-else statements.
|
||||
Shulkerscript and mcscript offer a more convenient way to write if-else statements.
|
||||
|
||||
<SplitView gap="10px">
|
||||
<Tabs slot="left">
|
||||
<TabItem label="ShulkerScript">
|
||||
<TabItem label="Shulkerscript">
|
||||
```shulkerscript
|
||||
// conditionals.shu
|
||||
fn conditional() {
|
||||
|
@ -201,13 +201,13 @@ ShulkerScript and mcscript offer a more convenient way to write if-else statemen
|
|||
|
||||
### Logical operators
|
||||
|
||||
Both in ShulkerScript and mcscript, logical operators can be used to combine multiple conditions.
|
||||
Both in Shulkerscript and mcscript, logical operators can be used to combine multiple conditions.
|
||||
In the following code examples, the conditions are represented by `A`, `B`, etc. as placeholders for real conditions.
|
||||
|
||||
<SplitView gap="10px">
|
||||
<Fragment slot="left">
|
||||
<Tabs>
|
||||
<TabItem label="ShulkerScript">
|
||||
<TabItem label="Shulkerscript">
|
||||
```shulkerscript
|
||||
// logical-operators.shu
|
||||
fn logical() {
|
||||
|
@ -250,7 +250,7 @@ In the following code examples, the conditions are represented by `A`, `B`, etc.
|
|||
|
||||
### Interfering with conditions
|
||||
|
||||
The difference between ShulkerScript and the other two languages is that ShulkerScript compiles to a version
|
||||
The difference between Shulkerscript and the other two languages is that Shulkerscript compiles to a version
|
||||
where it is not possible to trigger both the if and the else statement at the same time.
|
||||
This could be possible when using the trivial approach to translate the following to mcfunction:
|
||||
|
||||
|
@ -267,7 +267,7 @@ fn thisWorks() {
|
|||
|
||||
Here the second command will always be executed, because if the condition is true, the command runs and falsifies the condition.
|
||||
When the inverted condition is checked in the second command, it will always be true.
|
||||
ShulkerScript fixes this by using a mix of anonymous functions and data stores.
|
||||
Shulkerscript fixes this by using a mix of anonymous functions and data stores.
|
||||
|
||||
```mcfunction
|
||||
# this-is-incorrect.mcfunction
|
||||
|
@ -278,11 +278,11 @@ execute unless block ~ ~-1 ~ minecraft:stone run say Not on stone
|
|||
|
||||
## Embedded Programming Language
|
||||
|
||||
ShulkerScript allows running Lua code during compilation and running the returned output in Minecraft, mcscript offers JavaScript modals.
|
||||
Shulkerscript allows running Lua code during compilation and running the returned output in Minecraft, mcscript offers JavaScript modals.
|
||||
|
||||
<SplitView gap="10px">
|
||||
<Tabs slot="left">
|
||||
<TabItem label="ShulkerScript">
|
||||
<TabItem label="Shulkerscript">
|
||||
```shulkerscript
|
||||
// lua.shu
|
||||
fn execute() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
title: GitHub
|
||||
description: View and contribute to the source code of ShulkerScript on GitHub.
|
||||
description: View and contribute to the source code of Shulkerscript on GitHub.
|
||||
---
|
||||
|
||||
import { CardGrid, LinkCard, Aside } from "@astrojs/starlight/components";
|
||||
|
@ -32,6 +32,13 @@ The project is split into multiple repositories:
|
|||
description="Library for compiling the intermediate representation to a datapack that can be read by Minecraft.
|
||||
Also, provides an interface for constructing datapacks programatically in rust."
|
||||
/>
|
||||
<LinkCard
|
||||
title="shulkerscript-webpage"
|
||||
href="https://github.com/moritz-hoelting/shulkerscript-webpage"
|
||||
target="_blank"
|
||||
description="This website you are currently viewing.
|
||||
It is built with Astro and hosted on GitHub pages."
|
||||
/>
|
||||
|
||||
<Aside type="note" title="Keep in mind">
|
||||
Please raise issues in the respective repositories if it is related to a specific part of the project.
|
||||
|
|
|
@ -1,19 +1,64 @@
|
|||
---
|
||||
title: Getting Started
|
||||
description: Get started with ShulkerScript
|
||||
description: Get started with Shulkerscript
|
||||
---
|
||||
import { Steps, FileTree } from '@astrojs/starlight/components';
|
||||
import { Steps, FileTree, Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
|
||||
## Installation
|
||||
|
||||
To get started with ShulkerScript, you need to install the ShulkerScript CLI.
|
||||
To get started with Shulkerscript, you need to install the Shulkerscript CLI.
|
||||
You can either [download](#download-from-github) the latest release from the GitHub releases page or [build it from source](#building-from-source).
|
||||
|
||||
{/* :::tip
|
||||
Before you install the CLI, you can try it out in your browser by using the [online playground](/playground).
|
||||
::: */}
|
||||
|
||||
### Quickinstall script *(recommended)*
|
||||
<Steps>
|
||||
1. <Tabs>
|
||||
<TabItem label="Windows" icon="seti:windows">
|
||||
Open a PowerShell terminal and run
|
||||
```powershell
|
||||
iex (iwr "https://raw.githubusercontent.com/moritz-hoelting/shulkerscript-cli/main/install.ps1").Content
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="Linux / macOS" icon="linux">
|
||||
Open a bash terminal and run
|
||||
```bash
|
||||
curl -sfSL https://raw.githubusercontent.com/moritz-hoelting/shulkerscript-cli/main/install.sh | bash
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
2. Test the installation by running
|
||||
```bash
|
||||
shulkerscript --version
|
||||
```
|
||||
</Steps>
|
||||
|
||||
:::note[Info]
|
||||
The script will check if you have cargo-binstall installed and use it if available.
|
||||
Otherwise it will download the binary from GitHub if available for your platform.
|
||||
As a fallback it will build the CLI from source if Rust is installed.
|
||||
:::
|
||||
|
||||
### Download with cargo-binstall
|
||||
<Steps>
|
||||
1. Make sure you have [cargo-binstall](https://github.com/cargo-bins/cargo-binstall) installed. If not, follow the [installation instructions](https://github.com/cargo-bins/cargo-binstall?tab=readme-ov-file#installation).
|
||||
2. Run
|
||||
```bash
|
||||
cargo-binstall --git https://github.com/moritz-hoelting/shulkerscript-cli shulkerscript-cli
|
||||
```
|
||||
3. Test the installation by running
|
||||
```bash
|
||||
shulkerscript --version
|
||||
```
|
||||
</Steps>
|
||||
|
||||
### Download from GitHub
|
||||
<Steps>
|
||||
1. Go to the [GitHub releases page](https://github.com/moritz-hoelting/shulkerscript-cli/releases) and download the latest release for your platform.
|
||||
2. Extract the downloaded archive.
|
||||
3. Move the extracted binary to a directory in your PATH.
|
||||
3. Move the extracted binary to a directory in your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) *(required for the CLI to be accessible from anywhere)*.
|
||||
4. Test the installation by running
|
||||
```bash
|
||||
shulkerscript --version
|
||||
|
@ -22,11 +67,14 @@ You can either [download](#download-from-github) the latest release from the Git
|
|||
</Steps>
|
||||
|
||||
### Building from source
|
||||
:::caution
|
||||
This method takes the longest. If you have no reason to build from source, you may want to take a look at the other installation methods.
|
||||
:::
|
||||
<Steps>
|
||||
1. Make sure you have [Rust and Cargo](https://rustup.rs) installed.
|
||||
2. Install the CLI by running
|
||||
```bash
|
||||
cargo install --git https://github.com/moritz-hoelting/shulkerscript-cli.git
|
||||
cargo install --git https://github.com/moritz-hoelting/shulkerscript-cli
|
||||
```
|
||||
3. Test the installation by running
|
||||
```bash
|
||||
|
@ -42,7 +90,7 @@ You can either [download](#download-from-github) the latest release from the Git
|
|||
```bash
|
||||
shulkerscript init
|
||||
```
|
||||
This will create a new ShulkerScript project in the current directory.
|
||||
This will create a new Shulkerscript project in the current directory.
|
||||
4. Open the `pack.toml` file in your favorite text editor and configure the project to your liking.
|
||||
</Steps>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
title: Syntax
|
||||
description: Learn the syntax of ShulkerScript
|
||||
description: Learn the syntax of Shulkerscript
|
||||
---
|
||||
|
||||
## Comments
|
||||
|
@ -50,7 +50,7 @@ pub fn hello() {
|
|||
This code defines a function called `main` that will be executed every tick.
|
||||
|
||||
:::note
|
||||
ShulkerScript always requires at least one function annotated with `tick`, `load` or `deobfuscate`.
|
||||
Shulkerscript always requires at least one function annotated with `tick`, `load` or `deobfuscate`.
|
||||
Otherwise no `.mcfunction` files will be generated.
|
||||
:::
|
||||
|
||||
|
@ -109,7 +109,7 @@ from "./foo" import bar, baz;
|
|||
|
||||
## Tags
|
||||
In Minecraft, tags are used to group multiple items, blocks, entities, etc. together.
|
||||
In ShulkerScript, tags can be defined right in the code, where they are needed.
|
||||
In Shulkerscript, tags can be defined right in the code, where they are needed.
|
||||
```shulkerscript
|
||||
tag "foo" of "block" [
|
||||
"minecraft:stone",
|
||||
|
@ -223,7 +223,7 @@ In most cases, you can use [literal commands](#literal-commands) instead of the
|
|||
:::
|
||||
|
||||
## Lua Code
|
||||
The `lua` keyword is used to embed Lua code in your ShulkerScript code. It can be combined with the `run` keyword to include the result of the Lua code in the output.
|
||||
The `lua` keyword is used to embed Lua code in your Shulkerscript code. It can be combined with the `run` keyword to include the result of the Lua code in the output.
|
||||
```shulkerscript
|
||||
run lua() {
|
||||
-- Lua code goes here
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
title: Welcome to the ShulkerScript docs
|
||||
description: Get started writing your datapacks with ShulkerScript
|
||||
title: Welcome to the Shulkerscript docs
|
||||
description: Get started writing your datapacks with Shulkerscript
|
||||
template: splash
|
||||
hero:
|
||||
tagline: Intro to getting started with ShulkerScript
|
||||
tagline: Intro to getting started with Shulkerscript
|
||||
image:
|
||||
file: ../../assets/logo.webp
|
||||
actions:
|
||||
|
@ -25,10 +25,10 @@ import { Card, CardGrid } from '@astrojs/starlight/components';
|
|||
while at the same time providing powerful features not found in `.mcfunction` files.
|
||||
</Card>
|
||||
<Card title="Easy Functions" icon="add-document">
|
||||
Generate multiple function files from a single source file, and call them from Minecraft or other ShulkerScript files.
|
||||
Generate multiple function files from a single source file, and call them from Minecraft or other Shulkerscript files.
|
||||
</Card>
|
||||
<Card title="Written in Rust" icon="seti:rust">
|
||||
Fast compile times and a small binary size make ShulkerScript a great choice for your next project.
|
||||
Fast compile times and a small binary size make Shulkerscript a great choice for your next project.
|
||||
</Card>
|
||||
<Card title="Contribute to this project" icon="github">
|
||||
Contribute to [the CLI](https://github.com/moritz-hoelting/shulkerscript-cli) or [the compiler](https://github.com/moritz-hoelting/shulkerscript-lang).
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
title: Command-line interface reference
|
||||
description: Reference for the ShulkerScript command-line tool
|
||||
description: Reference for the Shulkerscript command-line tool
|
||||
---
|
||||
|
||||
The ShulkerScript CLI is a command-line tool for managing ShulkerScript projects.
|
||||
The Shulkerscript CLI is a command-line tool for managing Shulkerscript projects.
|
||||
|
||||
|
||||
## init
|
||||
|
@ -48,7 +48,9 @@ shulkerscript watch [OPTIONS] [PATH]
|
|||
Options:
|
||||
- `--no-initial` Do not run the command initially
|
||||
- `--debounce-time <DEBOUNCE_TIME>` The time to wait in ms after the last change before running the command [default: `2000`]
|
||||
- `--execute <COMMAND>` The commands (cli subcommands or shell commands) to execute in the project when changes have been detected [multi-arg, default: `build`]
|
||||
- `--execute <COMMAND>` The shulkerscript commands to execute in the project when changes have been detected [multi-arg, default: `build .`]
|
||||
- `--no-execute` Do not execute any predefined shulkerscript commands
|
||||
- `--shell` The shell commands to execute in the project when changes have been detected [multi-arg]
|
||||
|
||||
## clean
|
||||
Clean the output directory of the project at the specified path.
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
---
|
||||
title: Lua Integration
|
||||
description: Reference for writing Lua code in ShulkerScript
|
||||
description: Reference for writing Lua code in Shulkerscript
|
||||
sidebar:
|
||||
badge:
|
||||
text: WIP
|
||||
variant: caution
|
||||
---
|
||||
|
||||
ShulkerScript supports writing Lua code directly in your scripts. This allows you to use Lua's powerful features and libraries to extend the functionality of your scripts.
|
||||
Shulkerscript supports writing Lua code directly in your scripts. This allows you to use Lua's powerful features and libraries to extend the functionality of your scripts.
|
||||
|
||||
The Lua code is embedded in the ShulkerScript code using the `lua` keyword. In the future, you will be able to pass arguments to the Lua code, but for now, you can only write Lua code without arguments.
|
||||
The Lua code is embedded in the Shulkerscript code using the `lua` keyword. In the future, you will be able to pass arguments to the Lua code, but for now, you can only write Lua code without arguments.
|
||||
|
||||
Your Lua code should return a string value when used in combination with the run keyword. This string returned will be included in the output.
|
||||
|
||||
|
@ -25,13 +25,13 @@ run lua() {
|
|||
The following globals are available in the Lua environment:
|
||||
- `shu_location`: The relative filepath of the script being executed
|
||||
|
||||
After variables are introduced in ShulkerScript, it is planned to make them available in the Lua environment as well.
|
||||
After variables are introduced in Shulkerscript, it is planned to make them available in the Lua environment as well.
|
||||
|
||||
:::note
|
||||
If you can think of any other globals that should be available in the Lua environment, please let us know! This could include:
|
||||
- variables with values (like `shu_location`)
|
||||
- functions that calculate/modify values (general utility things not provided by Lua or specific to ShulkerScript)
|
||||
- functions that interact with the ShulkerScript environment (flags to set for the compiler to alter the build process)
|
||||
- functions that calculate/modify values (general utility things not provided by Lua or specific to Shulkerscript)
|
||||
- functions that interact with the Shulkerscript environment (flags to set for the compiler to alter the build process)
|
||||
|
||||
Please either write a mail or open an issue on GitHub. The links can be found in the upper right corner of the page.
|
||||
:::
|
|
@ -10,7 +10,7 @@ The project is configured in the `pack.toml` file at the root of the project. It
|
|||
# The name of the datapack
|
||||
name = "shulkerpack"
|
||||
# The description of the datapack
|
||||
description = "I created this datapack with ShulkerScript"
|
||||
description = "I created this datapack with Shulkerscript"
|
||||
# The pack format of the datapack (https://minecraft.wiki/w/Data_pack#Pack_format)
|
||||
pack_format = 26
|
||||
# The version of the datapack (currently not used)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
title: Roadmap
|
||||
description: Our Plans for the future of ShulkerScript.
|
||||
description: Our Plans for the future of Shulkerscript.
|
||||
hero:
|
||||
tagline: Our Plans for the future of ShulkerScript.
|
||||
tagline: Our Plans for the future of Shulkerscript.
|
||||
image:
|
||||
file: ../../assets/logo.webp
|
||||
actions:
|
||||
|
@ -24,7 +24,11 @@ import { Steps } from '@astrojs/starlight/components';
|
|||
Add support for variables and constants. Constants can be any type (string, number, etc.) and
|
||||
can be passed from function to function. They will be processed by the compiler. Variables will be
|
||||
mutable and can be changed at any time, and are stored as entries in minecraft scoreboards.
|
||||
3. **Your Ideas**\
|
||||
Do you have an idea for a feature that should be added to ShulkerScript?
|
||||
3. **Improved Migration**\
|
||||
The migration tool will detect that a function is contained in `tick`/`load` tag and will automatically
|
||||
add the corresponding annotation to the function declaration. Execute commands will be converted to
|
||||
execute blocks and `function` commands will be converted to function invocations.
|
||||
4. **Your Ideas**\
|
||||
Do you have an idea for a feature that should be added to Shulkerscript?
|
||||
Let us know by opening an issue on GitHub or writing a mail! Links can be found in the upper right corner of the page.
|
||||
</Steps>
|
|
@ -3,7 +3,7 @@ import type { LanguageInput } from "shiki";
|
|||
export const shulkerscriptGrammar: LanguageInput = {
|
||||
name: "shulkerscript",
|
||||
aliases: ["shu"],
|
||||
displayName: "ShulkerScript",
|
||||
displayName: "Shulkerscript",
|
||||
fileTypes: ["shu"],
|
||||
scopeName: "source.shulkerscript",
|
||||
patterns: [
|
||||
|
|
Loading…
Reference in New Issue