Java Shell
JavaShellPlugin operates as a disabled-by-default, hidden developer tool. It provides a lazily-created Groovy evaluator window with pre-bound RuneLite client, n3 Api.actions.*, and SDK query bindings.
- Entrypoint:
com.n3plugins.javashell.JavaShellPlugin - Descriptor:
[n3] Java Shell(hidden = true, session/developer console) - Config group: none (no persistent configuration)
- Enabled by default: no
- Break Handler: none (developer tool, not an automation plugin)
Architecture
The plugin registers a sidebarNavigationButton on startup. Clicking it lazily creates and toggles a standalone JavaShellFrame window. The plugin creates the frame and its Groovy executor on demand and disposes them on shutdown. The editor is a dependency-free Swing JTextArea.
Groovy Evaluator
GroovyExecutor evaluates session-only Groovy snippets using Groovy 3.0.17. Each execution:
- Creates a fresh
GroovyShellwith the plugin’s classloader. - Binds
client(RuneLiteClient) andclientThread(ClientThread) as instance variables. - Binds n3
Api.actions.*andsdk.query.*types as static API facades. - Redirects
System.out/System.errto the output pane for the duration of the snippet. - Captures and displays the evaluation result or any caught exception.
clientThread.invokeLater(...). Snippets read live game state directly. Only one script runs at a time; a running flag prevents concurrent dispatch.
:::warning[Caution]
Snippets execute with full access to the RuneLite client and n3 SDK. Arbitrary code can mutate game state, dispatch packets, and interfere with running automation. Use only for developer debugging and inspection.
Tab-dependent requested actions propagate WIDGET_HIDDEN and do not select a side tab. Use tabActions.open(...), wait until tabActions.isOpen(...) is true, and only then call the inventory, equipment, prayer, magic, or combat action.
:::
Pre-Bound Variables
Static bindings expose only static methods in autocompletion. Instance bindings (
client, clientThread) expose all public methods.
Editor
The editor window currently uses a plainJTextArea without syntax highlighting or completions. The execution bindings remain available; richer editor integration is deferred until it can be supplied without the removed FifeSoft runtime jars.
Controls
Output Pane
The output area displays capturedSystem.out/System.err text, evaluation results prefixed with => , and errors prefixed with Error: . The pane caps output at 40,000 characters and trims excess from the beginning.