RedScript VSCode Extension
Syntax highlighting and snippets for RedScript — a compiler targeting Minecraft Java Edition datapacks.
Features
Install
From VSIX (manual)
cd editors/vscode
npm install -g @vscode/vsce
vsce package
code --install-extension redscript-vscode-0.1.0.vsix
Note on .rs extension
RedScript uses .rs files, same as Rust. If you have the Rust extension installed, you may need to associate .rs files with RedScript manually:
// settings.json
{
"files.associations": {
"*.rs": "redscript"
}
}
Or use .mcrs extension (we may switch to this in future).
Usage
Write RedScript code with full syntax highlighting:
@tick(rate=20)
fn check_zombies() {
foreach (z in @e[type=zombie, distance=..10]) {
kill(z);
}
}
@on_trigger("claim_reward")
fn handle_claim() {
give(@s, "minecraft:diamond", 1);
}
Compile with the CLI:
redscript compile src/main.rs -o dist/mypack/
| |