SScript is a lightweight programming language for Minecraft server automation. Write scripts in Python-like syntax to execute commands, automate tasks, and control server behavior without touching Java code.
Core Purpose: Execute automated commands and logic on your Minecraft server.
- ๐ฏ Command Execution โ Run commands programmatically (
/say,/give,/setblock, etc.) - โ๏ธ Task Automation โ Run initialization scripts, scheduled tasks, bulk operations
- ๐ง Server Logic โ React to player actions (join/leave, chat, block breaks, deaths, sleep)
- ๐ Simple Syntax โ Python-like language anyone can learn
- โก Non-blocking โ Tasks run without freezing the server
1. Create a script auto-load in sscripts/load.ss:
log "Server starting up..."
func welcome():
run "fill 10 50 10 -10 90 -10 air"
end
welcome()2. Create event handler in sscripts/handlers.event.ss:
on player_join(player):
run "say " + player.name + " joined"
run "execute at " + player.name + " run fill ~10 50 ~10 ~-10 90 ~-10 air"
end
on player_chat(player, message):
log player.name + ": " + message
end3. Load and run:
/sscript run test.ss
/sscript debug on
/sscript debug off - no spam [Server]: ...
Done! Scripts execute without restart.
- Variables & Types: Strings, numbers, booleans, lists, objects
- Control Flow:
if/elif/else,for,while,try/catch - Functions: Define with
funcordef, call sync or async - Events: React to player actions, server events
- Built-ins: 60+ functions for players, blocks, math, strings, files
- Async Support: Background tasks with
waitkeyword
Execute scripts and control execution:
/sscript run <file> # Execute script
/sscript run <file> function <name> # Call specific function
/sscript monitor [all|<id>| ] # View running tasks
/sscript stop [all|<id>|<file>] # Stop running task
/sscript reload [all|<id>|<file>] # Restart task
/sscript debug [on|off] # Toggle debug output server
๐ Full documentation with examples and API reference:
- English: docs/en/index.md
- ะ ัััะบะธะน: docs/ru/index.md
- Language Guide โ Syntax, variables, control flow
- Functions & Async โ How functions work and when they block
- Commands Reference โ All
/sscriptcommands - Complete Built-ins โ 60+ functions
- Events Reference โ All 13 game events
- Advanced Features โ Error handling, selectors, NBT, HTTP
Beyond command execution, SScript can:
- ๐ Store Data โ Global variables persist across restarts (
globals.json) - ๐ก HTTP Requests โ Fetch data from APIs or send webhooks
- ๐พ File I/O โ Read/write files and JSON
- ๐ฎ Player Data โ Access health, gamemode, coordinates, NBT data
- ๐ท๏ธ Tag System โ Organize players with custom tags
- ๐ Selectors โ Query players dynamically (
@a[tag=admin],@a[distance=..100])
- โก Tick-safe โ Tasks automatically spread across server ticks to prevent lag
- ๐ Non-blocking โ Event handlers run asynchronously (don't freeze gameplay)
- ๐ช Limits โ 500 max processes, 20 spawn/tick, 50 statements/tick
- Java 21+
- Fabric Loader 0.14+
- Minecraft 1.21.11
- Download the mod JAR
- Put in
mods/folder - Start server
- Place scripts in
sscripts/
# sscripts/chat_logger.event.ss
func log_chat(player_name, message):
file_mkdirs("sscripts/logs")
line = "[" + player_name + "] " + message
file_append("sscripts/logs/chat.log", line + "\n")
end
on player_chat(player, message):
log_chat(player.name, message)
end