Files

44 lines
2.3 KiB
Markdown
Raw Permalink Normal View History

2026-03-10 23:54:23 -04:00
# Script Editor & Scripting Enhancements
---
2026-03-11 17:11:57 -04:00
The script editor has been rebuilt into a **full-featured code editor** inside Minecraft with syntax highlighting, autocomplete, error detection, and Java scripting support.
2026-03-10 23:54:23 -04:00
---
## Script Editor
### Writing Code
2026-03-11 17:11:57 -04:00
- **Syntax Highlighting** - Color-coded keywords, types, variables, methods, strings, comments. Context-aware coloring for locals, globals, and chained calls
- **Autocomplete** - Smart suggestions with static/instance context awareness, frequency-based ordering, and smart cursor placement for method parameters. Auto-imports for class names
- **Error Detection** - Catches wrong argument types, missing methods, type mismatches, unused imports with detailed hover messages
- **Built-in Globals** - ECMAScript 5.1 objects (`Math`, `JSON`, `Date`, `Number`) and script globals (`npc`, `world`, `event`) recognized automatically
- **JS Language Support** - Arrow functions, shorthand methods, object literals, and array expressions understood by highlighter and type resolver
2026-03-10 23:54:23 -04:00
2026-03-11 17:11:57 -04:00
> Hover any symbol for **full type info and documentation** with JSDoc markdown formatting, scrollable tooltips, and code blocks.
2026-03-10 23:54:23 -04:00
### Navigation
2026-03-11 17:11:57 -04:00
`CTRL+G` Go to Line, `CTRL+F` Search, `CTRL+H` Replace, `CTRL+Click` Go to Definition, Fullscreen Mode.
2026-03-10 23:54:23 -04:00
### Editing
2026-03-11 17:11:57 -04:00
Undo/Redo (word-level), Duplicate Line (`CTRL+D`), Comment Toggle (`CTRL+/`), Rename (all occurrences), Move Lines, Copy Whole Line (empty selection), Triple Click (select line).
2026-03-10 23:54:23 -04:00
### Visual Polish
2026-03-11 17:11:57 -04:00
Line numbers with current line highlight, smooth scrolling, indent guides (green current scope), brace matching (red unclosed), smart bracket auto-close, resizable/pannable panels, keyboard shortcut overlay.
2026-03-10 23:54:23 -04:00
---
## Java Scripting (Janino)
2026-03-11 17:11:57 -04:00
Write scripts in **real Java** compiled natively via the **Janino** compiler. Full Java language support (classes, interfaces, enums, generics, lambdas, method references). Automatic hook resolution by method name. Per-tab language selector to mix Java and JavaScript. Works in NPC, Player, Forge, Recipe, Effect, and Linked Item scripts. External `.java` files load automatically.
2026-03-10 23:54:23 -04:00
---
## Client-Side Scripting
2026-03-11 17:11:57 -04:00
Scripts can run **on the client** — server-controlled, auto-synced on login and reload, off by default. Enables custom UI effects, visual feedback, and client-only hooks while the server stays in control.
2026-03-10 23:54:23 -04:00