LiveScript
LiveScript is an in-game JavaScript and Lua scripting mod for NeoForge 1.21.1. It combines the flexibility of KubeJS with the live editing experience of ComputerCraft — but with a modern fullscreen editor directly inside Minecraft.
Security & Sandboxing
LiveScript embeds Mozilla Rhino (JavaScript) and LuaJ (Lua) as sandboxed scripting engines. Scripts cannot:
- Access the filesystem (
java.io.File,java.nio.file.*blocked) - Start subprocesses (
java.lang.Runtime,java.lang.ProcessBuilderblocked) - Use reflection (
java.lang.reflect.*blocked) - Make network requests (
java.net.*blocked)
Each script has a 5-second CPU timeout. Only server operators (permission level 2, i.e. /op) can open the editor or execute scripts. The /scripteditor command uses the same permission gate as /give or /setblock.
This is the same security model as KubeJS, GroovyScript, CraftTweaker, and ComputerCraft.
Full source code: https://github.com/GrafKakashi/livescript — verify the sandbox in JsEngine.java and LuaEngine.java.
Features
- Fullscreen in-game code editor
- JavaScript (Rhino) and Lua (LuaJ) support
- Live script execution and hot-reload
- Syntax highlighting
- Autocomplete
- Undo / Redo
- Code folding
- Find & Replace
- Runtime event APIs
- Recipe manipulation APIs
- Custom item registration via
items.jsonwith runtime textures - Tag and item utilities
- Startup scripts with priority ordering
- Built-in script console
- Sandbox and timeout protection
- CurseForge update notifications for operators
Included APIs
Events
Listen to gameplay events like:
player.join,player.leave,player.chat,player.death,player.respawn,player.dimension_changeblock.break,block.placeitem.craft,item.smelt,item.use,item.use_block,item.pickupentity.spawn,entity.death,entity.damagemob.targetexplosion.start,explosion.detonateserver.tick
Recipes
Add or remove recipes at runtime — all 5 cooking types (smelting, smoking, blasting, campfire, stonecutting) plus shaped/shapeless crafting:
```javascript recipe.shapedAdd({ id: 'livescript:magic_diamond', pattern: ['DDD', 'DND', 'DDD'], key: { D: 'minecraft:diamond', N: 'minecraft:nether_star' }, result: { item: 'minecraft:diamond', name: '§bMagic Diamond', lore: ['§7Pulsates with arcane energy'], glow: true } });
recipe.removeByOutput('minecraft:torch'); ```
Custom Items
Define custom items in config/livescript/items.json, drop PNG textures in config/livescript/textures/, restart server:
```json { "items": { "magic_dust": { "display_name": "Magic Dust", "max_stack_size": 64, "rarity": "rare" } } } ```
Tags & Items
tag.itemsIn('minecraft:logs'), tag.itemHas(itemStack, 'minecraft:logs'), item.byId('minecraft:diamond'), and more.
Quick Start
- Install the mod (NeoForge 1.21.1)
- Start your world / server
- As operator, run
/scripteditor - Press the + button, create
example.js, write some code, click Save & Run
Links
- Source: https://github.com/GrafKakashi/livescript
- Issues: https://github.com/GrafKakashi/livescript/issues
- License: MIT
Compatibility
- Minecraft 1.21.1 only
- NeoForge 21.1+
- Works alongside KubeJS, CC: Tweaked, and other scripting mods (no classpath conflicts thanks to shaded Rhino/LuaJ)

